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}\),第一次从原 ...
随机推荐
- 常用汉字的Unicode码表
\u96d5\u864e\u7684\u4e00\u4e86\u662f\u6211\u4e0d\u5728\u4eba\u4eec\u6709\u6765\u4ed6\u8fd9\u4e0a\u77 ...
- NodeJS下访问SQL Server
1.下载node-sqlserver (1)msnodesql (msnodesql-0.2.1-v0.8-x64.msi)下载地址:下载 自行选择与自己系统相符的版本,点击安装. (2)msnod ...
- Timer 的缺陷
java.util.Timer计时器有管理任务延迟执行("如1000ms后执行任务")以及周期性执行("如每500ms执行一次该任务").但是,Timer存在一 ...
- JS读取UserAgent信息并做判断
JS读取UserAgent信息并做判断 userAgent信息可以由navigator.userAgent拿到.例子: <script type="text/javascript&qu ...
- 2014 Multi-University Training Contest 8
官方解题报告:http://blog.sina.com.cn/s/blog_a19ad7a10102uzj7.html Area of Mushroom http://acm.hdu.edu.cn/s ...
- PHP对XML文件操作之属性与方法讲解
DOMDocument相关的内容. 属性: Attributes 存储节点的属性列表(只读) childNodes 存储节点的子节点列表(只读) dataType 返回此节点的数据类型 Definit ...
- 【Asp.Net MVC】Avoid Mass Assignment in ASP.NET MVC
Mass Assignment Vulnerability in ASP.NET MVC: http://freshbrewedcode.com/joshbush/2012/03/05/mass-as ...
- 一个碉堡的swing类
今天遇到一个掉了一笔的swing类.可以完美的解决JFrame下设置背景的问题.任意size.太掉了.特记于此 import java.awt.*; import java.awt.image.Buf ...
- C# 常用的工具类
编码解码.图片与byte[].日志文件写入和读取 /// <summary> /// 将字符串编码为Base64字符串 /// </summary> /// <param ...
- 【设计模式六大原则2】里氏替换原则(Liskov Substitution Principle)
肯定有不少人跟我刚看到这项原则的时候一样,对这个原则的名字充满疑惑.其实原因就是这项原则最早是在1988年,由麻省理工学院的一位姓里的女士(Barbara Liskov)提出来的. 定义1:如果对 ...