题目: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的更多相关文章

  1. 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 ...

  2. 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 ...

  3. Codeforces #541 (Div2) - E. String Multiplication(动态规划)

    Problem   Codeforces #541 (Div2) - E. String Multiplication Time Limit: 2000 mSec Problem Descriptio ...

  4. Codeforces #548 (Div2) - D.Steps to One(概率dp+数论)

    Problem   Codeforces #548 (Div2) - D.Steps to One Time Limit: 2000 mSec Problem Description Input Th ...

  5. [codeforces 235]A. LCM Challenge

    [codeforces 235]A. LCM Challenge 试题描述 Some days ago, I learned the concept of LCM (least common mult ...

  6. Codeforces #180 div2 C Parity Game

    // Codeforces #180 div2 C Parity Game // // 这个问题的意思被摄物体没有解释 // // 这个主题是如此的狠一点(对我来说,),不多说了这 // // 解决问 ...

  7. Codeforces #541 (Div2) - F. Asya And Kittens(并查集+链表)

    Problem   Codeforces #541 (Div2) - F. Asya And Kittens Time Limit: 2000 mSec Problem Description Inp ...

  8. Codeforces #541 (Div2) - D. Gourmet choice(拓扑排序+并查集)

    Problem   Codeforces #541 (Div2) - D. Gourmet choice Time Limit: 2000 mSec Problem Description Input ...

  9. 【Codeforces #312 div2 A】Lala Land and Apple Trees

    # [Codeforces #312 div2 A]Lala Land and Apple Trees 首先,此题的大意是在一条坐标轴上,有\(n\)个点,每个点的权值为\(a_{i}\),第一次从原 ...

随机推荐

  1. SharePoint 2010/SharePoint 2013 Custom Action: 基于Site Collection 滚动文字的通知.

    应用场景: 有时候我们的站点需要在每个页面实现滚动文字的通知,怎么在不修改Master Page的情况下实现这个功能?我们可以使用Javascript 和 Custom Action 来实现. 创建一 ...

  2. 打造自己的程序员品牌(摘自Infoq)

    John Sonmez是Simple Programmer的创始人.作者与程序员,关注于如何让复杂的事情变得简单.他是一位专业的软件开发者.架构师与讲师,感兴趣的领域包括测试驱动开发.如何编写整洁的代 ...

  3. Python Socket File Transfer

    I have a RPi which I intented to use it to crawl data. The development environment in RPi is very ba ...

  4. Graduate Summer School: Deep Learning, Feature Learning

    http://www.ipam.ucla.edu/programs/summer-schools/graduate-summer-school-deep-learning-feature-learni ...

  5. ural 1869

    简单题 ~~ #include <cstdio> #include <cstring> #include <iostream> using namespace st ...

  6. hadoop+hbase

    hadoop的配置见下面这篇文章 http://www.powerxing.com/install-hadoop-2-4-1-single-node/ Hadoop安装教程_单机/伪分布式配置_Had ...

  7. POJ2488A Knight's Journey

    http://poj.org/problem?id=2488 题意 : 给你棋盘大小,判断马能否走完棋盘上所有格子,前提是不走已经走过的格子,然后输出时按照字典序排序的第一种路径 思路 : 这个题吧, ...

  8. hdu 4412 Sky Soldiers DP

    动态规划,主要是用单调性求区间的最小期望. 代码如下: #include<iostream> #include<stdio.h> #include<algorithm&g ...

  9. eclipse 或MyEclipse将工程进行移动的时候会对@Override报错的处理方法

    有时候导入javaSE,javaEE,android 工程的时候,明明是刚刚用过的没有问题的工程,但重新导入的时候就报错. 提示The method ... must override a sperc ...

  10. 欧拉工程第64题:Odd period square roots

    题目链接 找循环位数是奇数的数有多少个 这个自己很难写出来,完全不能暴力 维基百科链接 维基百科上面说的很好,上面的算法实现就好了. 就是上面的 Java程序: package project61; ...