Codeforces 590D Top Secret Task】的更多相关文章

D. Top Secret Task time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output A top-secret military base under the command of Colonel Zuev is expecting an inspection from the Ministry of Defence. Acc…
D. Top Secret Task time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output A top-secret military base under the command of Colonel Zuev is expecting an inspection from the Ministry of Defence. Acc…
Case of a Top Secret 感觉除了两个点在那循环的部分, 其他时候绳子的长度每次变为一半一下, 就变成了Log(l)步.. 然后就暴力找就好啦, 循环的部分取个模. #include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define PLL pair<LL, LL> #define PLI pair<LL, in…
E. A Simple Task Problem's Link: http://codeforces.com/problemset/problem/558/E Mean: 给定一个字符串,有q次操作,每次操作将(l,r)内的字符升序或降序排列,输出q次操作后的字符串. analyse: 基本思想是计数排序. 所谓计数排序,是对一个元素分布较集中的数字集群进行排序的算法,时间复杂度为O(n),但使用条件很苛刻.首先对n个数扫一遍,映射出每个数字出现的次数,然后再O(n)扫一遍处理出:对于数字ai,…
题目链接:http://codeforces.com/contest/70/problem/D Once a walrus professor Plato asked his programming students to perform the following practical task. The students had to implement such a data structure that would support a convex hull on some set of…
题目链接:http://codeforces.com/contest/558/problem/E E. A Simple Task time limit per test5 seconds memory limit per test512 megabytes inputstandard input outputstandard output   This task is very simple. Given a string S of length n and q queries each qu…
题目描述:  A Simple Task time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Given a simple graph, output the number of simple cycles in it. A simple cycle is a cycle with no repeated vertices or…
题目链接:http://codeforces.com/contest/558/problem/E 题意:有一串字符串,有两个操作:1操作是将l到r的字符串升序排序,0操作是降序排序. 题解:建立26棵线段树,类似计数排序思想. #include <bits/stdc++.h> using namespace std; ; struct SegTree { ], sum[], l, r; }T[N << ]; ][N]; void pushup(int p, int c) { T[p…
原题链接:788E - New task Description 游行寺家里人们的发色多种多样,有基佬紫.原谅绿.少女粉.高级黑.相簿白等. 日向彼方:吾令人观其气,气成五彩,此天子气也. 琉璃:我们是不是可以组个五人战队了? 游行寺家的n个人排成一排.第i个人的发色是Ai. 能组成战队的条件是: 那五人假设是第a,b,c,d,e人(),需要满足  中间的三人称为有头者,最旁边俩人称为学姐. 根据字面意思,有头者一定要有头,学姐可以无头.反正就是b,c,d这三人一定要有头. 有着恶趣味的琉璃每次…
This task is very simple. Given a string S of length n and q queries each query is on the format i j k which means sort the substring consisting of the characters from i to j in non-decreasing order if k = 1 or in non-increasing order if k = 0. Outpu…