CodeForces - 315A Sereja and Bottles Time Limit: 2000MS Memory Limit: 262144KB 64bit IO Format: %I64d & %I64u Submit Status Description Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle ope…
这次周赛题目拉了CF315和CF349两套题. 因为我代码模板较长,便只放出关键代码部分 #define ll long long #define MMT(s,a) memset(s, a, sizeof s)#define GO(i,a,b) for(int i = (a); i < (b); ++i)#define GOE(i,a,b) for(int i = (a); i <= (b); ++i)#define OG(i,a,b) for(int i = (a); i > (b);…
A. Sereja and Bottles 模拟. B. Sereja and Array 维护全局增量\(Y\),对于操作1(即\(a_{v_i}=x\))操作,改为\(a_{v_i}=x-Y\). C. Sereja and Contest 观察式子\(d_i=\sum_{j=1}^{i-1}{(a_j\cdot(j-1)-(n-i)\cdot a_i)}\) 假设最先排除的是\(k\),那么对于\(i<k\)的数是不会有影响的,因为\(d_i\)会因为总人数\(n\)的减少而变大. D.…
C. Sereja and Brackets time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Sereja has a bracket sequence s1, s2, ..., sn, or, in other words, a string s of length n, consisting of characters "(…
C. Recycling Bottles time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output It was recycling day in Kekoland. To celebrate it Adil and Bera went to Central Perk where they can take bottles from t…
C. Recycling Bottles It was recycling day in Kekoland. To celebrate it Adil and Bera went to Central Perk where they can take bottles from the ground and put them into a recycling bin. We can think Central Perk as coordinate plane. There are n bott…