codeforces 235 div2 C Team
题目:http://codeforces.com/contest/401/problem/C
题意:n个0,m个1,求没有00或111的情况。
这么简单的题。。。。。
做题的时候脑残了。。。,今天,贴一下ac的代码,警示一下自己
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std; int main()
{
int n, m;
int i;
while(cin>>m>>n)
{ if(n>=m-&&(n+)/<=m+)
{
if(m > n)
{
for(i = ; i <= n; i++)
printf("");
printf("");
}
else
{
while(m>&&n>)
{
if(n>m&&n>=)
{
printf("");
n -= ;
}
else
{
printf("");
n--;
}
printf("");
m--;
}
while(n--)
{
printf("");
}
while(m--)
{
printf("");
}
}
printf("\n");
}
else
printf("-1\n");
}
return ;
}
codeforces 235 div2 C Team的更多相关文章
- codeforces 235 div2 B. Sereja and Contests
Sereja is a coder and he likes to take part in Codesorfes rounds. However, Uzhland doesn't have good ...
- codeforces 235 div2 A. Vanya and Cards
Vanya loves playing. He even has a special set of cards to play with. Each card has a single integer ...
- Codeforces #541 (Div2) - E. String Multiplication(动态规划)
Problem Codeforces #541 (Div2) - E. String Multiplication Time Limit: 2000 mSec Problem Descriptio ...
- Codeforces #548 (Div2) - D.Steps to One(概率dp+数论)
Problem Codeforces #548 (Div2) - D.Steps to One Time Limit: 2000 mSec Problem Description Input Th ...
- [codeforces 235]A. LCM Challenge
[codeforces 235]A. LCM Challenge 试题描述 Some days ago, I learned the concept of LCM (least common mult ...
- Codeforces #180 div2 C Parity Game
// Codeforces #180 div2 C Parity Game // // 这个问题的意思被摄物体没有解释 // // 这个主题是如此的狠一点(对我来说,),不多说了这 // // 解决问 ...
- Codeforces #541 (Div2) - F. Asya And Kittens(并查集+链表)
Problem Codeforces #541 (Div2) - F. Asya And Kittens Time Limit: 2000 mSec Problem Description Inp ...
- Codeforces #541 (Div2) - D. Gourmet choice(拓扑排序+并查集)
Problem Codeforces #541 (Div2) - D. Gourmet choice Time Limit: 2000 mSec Problem Description Input ...
- 【Codeforces #312 div2 A】Lala Land and Apple Trees
# [Codeforces #312 div2 A]Lala Land and Apple Trees 首先,此题的大意是在一条坐标轴上,有\(n\)个点,每个点的权值为\(a_{i}\),第一次从原 ...
随机推荐
- Express/Koa/Hapi
Express/Koa/Hapi 本文翻译自: https://www.airpair.com/node.js/posts/nodejs-framework-comparison-express-ko ...
- C++中使用心得
1.struct成员默认访问方式是public,而 class默认访问方式是private! 2.exit函数终止程序执行会调用析构函数 ,abort函数终止程序不会调用析构函数! 3.静态局部变量直 ...
- 高效开发Android App的10个建议(转)
假如要Google Play上做一个最失败的案例,那最好的秘诀就是界面奇慢无比.耗电.耗内存.接下来就会得到用户的消极评论,最后名声也就臭了.即使你的应用设计精良.创意无限也没用. 耗 电或者内存占用 ...
- 关于JS的一些代码效果图
关于JS的一些代码效果图 1.几乎所有DOM元素都有innerText.innerHTML属性(注意大小写),分别是元素标签内内容的文本表示形式和HTML源代码,这两个属性是可读可写的. 需要注意的是 ...
- iOS$299企业账号In House ipa发布流程
1.在Mac系统中进入“钥匙串访问”,选择“钥匙串访问”-“证书助理”-“从证书颁发机构请求证书”. 填写前两项,并保存在本地. 2.登录https://developer.apple.com,进入i ...
- 一个有趣的 SQL 查询(查询7天连续登陆)
一个有趣的 SQL 查询 一个朋友有这样一个SQL查询需求: 有一个登录表(tmp_test),包含用户ID(uid)和登录时间(login_time).表结构如下: . row ********** ...
- 使用Forms进行身份验证(Asp.net)
1.背景 以往项目登陆后的用户信息都是存放在session中,但session有一个问题就是读取的时候需要先实例化所在类,在调用对象()如果用static修饰,则可能到时多次登陆sessio ...
- Asp.Net原理Version1.0
Asp.Net原理Version2.0 Asp.Net原理Version3.0_页面声明周期
- [vijos 1770]大内密探
描述 在古老的皇宫中,有N个房间以及N-1条双向通道,每条通道连接着两个不同的房间,所有的房间都能互相到达.皇宫中有许多的宝物,所以需要若干个大内密探来守护.一个房间被守护当切仅当该房间内有一名大内密 ...
- error: The shader requires a sampler in slot 0 which hasn't been set [XXXsampler]
About the sampler, you need to assign it to your pixelshader. m_d3dContext.Get()->PSSetSamplers(0 ...