[题目链接]

https://codeforces.com/contest/1004/problem/B

[算法]

不难发现 , 最优解一定是01010101....

时间复杂度 : O(N)

[代码]

#include<bits/stdc++.h>
using namespace std; template <typename T> inline void read(T &x)
{
T f = ; x = ;
char c = getchar();
for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
for (; isdigit(c); c = getchar()) x = (x << ) + (x << ) + c - '';
x *= f;
} int main()
{ int n,m;
read(n); read(m);
for (int i = ; i <= m; i++)
{
int a,b;
read(a); read(b);
}
for (int i = ; i <= n; i++) printf("%d",(i % ) ? : );
printf("\n"); return ; }

[Codeforces Round495B] Sonya and Exhibition的更多相关文章

  1. B - Sonya and Exhibition CodeForces - 1004B (思维题)

    B. Sonya and Exhibition time limit per test 1 second memory limit per test 256 megabytes input stand ...

  2. Sonya and Exhibition 1004B

    B. Sonya and Exhibition time limit per test 1 second memory limit per test 256 megabytes input stand ...

  3. Codeforces 714C. Sonya and Queries Tire树

    C. Sonya and Queries time limit per test:1 second memory limit per test: 256 megabytes input:standar ...

  4. Codeforces 713A. Sonya and Queries

    题目链接:http://codeforces.com/problemset/problem/713/A 题意: Sonya 有一个可放置重复元素的集合 multiset, 初始状态为空, 现给予三种类 ...

  5. Codeforces 713C Sonya and Problem Wihtout a Legend(单调DP)

    [题目链接] http://codeforces.com/problemset/problem/713/C [题目大意] 给出一个数列,请你经过调整使得其成为严格单调递增的数列,调整就是给某些位置加上 ...

  6. CodeForces 1151F Sonya and Informatics

    题目链接:http://codeforces.com/problemset/problem/1151/F 题目大意: 给定长度为 n 的 01 序列,可以对该序列操作 k 次,每次操作可以交换序列中任 ...

  7. Codeforces 713C Sonya and Problem Wihtout a Legend DP

    C. Sonya and Problem Wihtout a Legend time limit per test 5 seconds memory limit per test 256 megaby ...

  8. Codeforces C. Sonya and Problem Wihtout a Legend(DP)

    Description Sonya was unable to think of a story for this problem, so here comes the formal descript ...

  9. Codeforces 713C Sonya and Problem Wihtout a Legend(DP)

    题目链接   Sonya and Problem Wihtout a Legend 题意  给定一个长度为n的序列,你可以对每个元素进行$+1$或$-1$的操作,每次操作代价为$1$. 求把原序列变成 ...

随机推荐

  1. GetArxPath

    extern HINSTANCE _hdllInstance;CString GetArxPath(){ CString strArxPath; GetModuleFileName(_hdllInst ...

  2. nginx做反向代理配置文件的例子

    worker_processes ; error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error ...

  3. PHP封装数据库

    (1)按照步骤封装数据库 ①引入抽象类和抽象方法,即引入模板: ②继承抽象类,注意参数(规定几个就传入几个): ③逐个写入抽象方法,必须一一对应:(抽象方法必须一一引入,否则会报错-->有个抽象 ...

  4. ProgressDialog的样式

    ProgressDialog的样式有两种,一种是圆形不明确状态,一种是水平进度条状态 第一种方式:圆形进度条 final ProgressDialog dialog = new ProgressDia ...

  5. 06二叉树、Map、Collections、适配器

    06二叉树.Map.Collections.适配器-2018/07/16 1.set集合,无索引,不可以重复,无序(存取不一致) 2.TreeSet用来对象元素进行排序,可以保证元素唯一 储存自定义对 ...

  6. 洛谷——P2709 小B的询问

    P2709 小B的询问 莫队算法,弄两个指针乱搞即可 这应该是基础莫队了吧 $x^2$可以拆成$((x-1)+1)^2$,也就是$(x-1)^2+1^2+2\times (x-1)$,那么如果一个数字 ...

  7. ZOJ - 3992 - One-Dimensional Maze (思维)

    题意: 一条长度为n的直线,你一开始在位置m上 其中每个整点都有一个字符'L'或'R',如果是'L'那么你必须往左走一步,否则往右走一步 如果你到达位置1或位置n你任务就完成了 不过有可能你永远到不了 ...

  8. HDU_5783_DivideTheSequence

    HDU_5783_DivideTheSequence  点击打开链接 题意: 生成尽量多的连续的子串,且子串的前缀和大于等于0,输出符合题意的子串的数量. 这题目是参加四月份的个人训练赛遇到的,挺水的 ...

  9. Codeforces Round #530 (Div. 2) (前三题题解)

    总评 今天是个上分的好日子,可惜12:30修仙场并没有打... A. Snowball(小模拟) 我上来还以为直接能O(1)算出来没想到还能小于等于0的时候变成0,那么只能小模拟了.从最高的地方进行高 ...

  10. MySQL数据库开启、关闭、查看函数功能的方法

    应用 MySQL 时,会遇到不能创建函数的情况.出现如下错误信息: ERROR 1418 : This function has none of DETERMINISTIC, NO SQL, or R ...