题目链接:http://codeforces.com/problemset/problem/282/E E. Sausage Maximization time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The Bitlandians are quite weird people. They have their own prob…
题目链接:http://codeforces.com/problemset/problem/665/E (http://www.fjutacm.com/Problem.jsp?pid=2255) 题意:找出有多少个连续的区间[l,r](1 ≤ l ≤ r ≤ n),该区间中所有的数的异或值大于等于k: 思路:首先,如果是单看题目的话,会发现暴力的话复杂度是O(n^3),但是我们先预处理异或前缀和,然后你会发现[l,r]区间的异或和等于s[l-1]^s[r],这样就可以O(n^2)的求…
As you might remember from the previous round, Vova is currently playing a strategic game known as Rage of Empires. Vova managed to build a large army, but forgot about the main person in the army - the commander. So he tries to hire a commander, and…
传送门 D. Good Substrings time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output You've got string s, consisting of small English letters. Some of the English letters are good, the rest are bad. A s…
题目链接:http://codeforces.com/problemset/problem/706/D 题意:q次操作,可以向多重集中增添,删除,询问异或最大值. 思路:转化为二进制用字典树存储,数字从高位开始,并全部固定位30位. #include<bits/stdc++.h> using namespace std; const int N=2e5 + 5; int now = 1 ,Trie[N<<5][2] ,num[N<<5]; void Insert(int…
E. Ann and Half-Palindrome Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/problem/E Description Tomorrow Ann takes the hardest exam of programming where she should get an excellent mark. On the last theoretical class t…