B. Balanced Substring time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given a string s consisting only of characters 0 and 1. A substring [l, r] of s is a string slsl + 1sl + 2... s…
Educational Codeforces Round 30  A. Chores 把最大的换掉 view code #pragma GCC optimize("O3") #pragma GCC optimize("Ofast,no-stack-protector") #include<bits/stdc++.h> using namespace std; #define INF 0x3f3f3f3f #define endl "\n&quo…
Educational Codeforces Round 40 (Rated for Div. 2) C. Matrix Walk time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There is a matrix A of size x × y filled with integers. For every , *A**i, …
题意:给你n和k,n代表有多少个数,k代表几次操作,求一个1到n的序列,要k次mergesort操作才能还原 Examples Input 3 3 Output 2 1 3 Input 4 1 Output 1 2 3 4 Input 5 6 Output -1 思路:看了很久才看懂题目的意思,根据题意对于一个[l,r)的区间,如果是乱的,你会先mergesort一下,如果已经是递增的, 那么就不用继续往下操作了:如果不是递增的,那么就要分一下,对左边[l,mid)操作,右边[mid,r)操作,…
A. Chores time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Luba has to do n chores today. i-th chore takes ai units of time to complete. It is guaranteed that for every  the conditionai ≥ a…
#include<bits/stdc++.h>using namespace std;char s[100007];long long a[100007];long long dp[100007][4];int main(){    int n;    scanf("%d",&n);    scanf("%s",s);    for(int i=0;i<n;i++)        scanf("%lld",&a[…
A. Grandma Laura and Apples 题目连接: http://www.codeforces.com/contest/632/problem/A Description Grandma Laura came to the market to sell some apples. During the day she sold all the apples she had. But grandma is old, so she forgot how many apples she…
E. Army Creation time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output As you might remember from our previous rounds, Vova really likes computer games. Now he is playing a strategy game known a…
A. Digits Sequence Dividing(英文速读) 练习英语速读的题,我还上来昏迷一次....只要长度大于2那么一定可以等于2那么前面大于后面就行其他no 大于2的时候分成前面1个剩下后面一定是对的因为按照数字大小 代码 #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin>>n;…
[Educational Codeforces Round 81 (Rated for Div. 2)]E. Permutation Separation(线段树,思维,前缀和) E. Permutation Separation time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given a permutat…