CF962D 题意: 给定一个数列,对于靠近左端的两个相同大小的值x可以合并成一个点.把x 乘以2 放在第二个点的位置,问最后的数列大小和每个位子的值. 思路: 利用set 配上 pair 就行了,感觉很巧妙,每次取出前两个pll  t1,t2. 如果 t1.first != t2.first ,把t2直接重新放入set中,否则,把t2.first * 2并更新t2.second 位子,把t2放入到set中.(这么说好像优先队列也可以) #include <iostream> #include…
http://codeforces.com/contest/962/problem/D D. Merge Equals time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given an array of positive integers. While there are at least two equal…
D. Merge Equals time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output You are given an array of positive integers. While there are at least two equal elements, we will perform the following operatio…
A. Equator(模拟) 找权值的中位数,直接模拟.. 代码写的好丑qwq.. #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> using namespace std; ; inline int read() { , f = ; ; c = getchar();} + c - ', c = getchar(); return x * f; } int N; in…
模拟题,运用强大的stl. #include <iostream> #include <map> #include <algorithm> #include <set> #define N 150005 using namespace std; typedef long long Int; ; map<long long, set<int> > mapp; long long a[N]; int main() { int n; cin…
http://codeforces.com/contest/962/problem/E E. Byteland, Berland and Disputed Cities time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The cities of Byteland and Berland are located on the a…
http://codeforces.com/contest/962/problem/F 求没有被两个及以上的简单环包含的边 解法:双联通求割顶,在bcc中看这是不是一个简单环,是的话把整个bcc的环加到答案中即可(正确性显然,因为bcc一定是环了,然后如果一个bcc不是简单环,那么所有边一定包含在两个简单环中) //#pragma comment(linker, "/stack:200000000") //#pragma GCC optimize("Ofast,no-stac…
C. Make a Square time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given a positive integer nn, written without leading zeroes (for example, the number 04 is incorrect). In one opera…
A. Equator time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Polycarp has created his own training plan to prepare for the programming contests. He will train for nn days, all days are numbe…
C. Make a Square time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output You are given a positive integer n, written without leading zeroes (for example, the number 04 is incorrect). In one operation…