By vintage_Vlad_Makeev, 5 years ago, translation,

Hello!

Right now happens the first tour of the Open Olympiad in Informatics, and tomorrow will be the second one. This contest is prepared by Moscow Olympiad Scientific Committee that you may know by Moscow Team Olympiad, Moscow Olympiad for Young Students and Metropolises Olympiad (rounds 327, 342, 345, 376, 401, 433, 441, 466, 469, 507, 516, 541, 545, 567, 583, 594, 622).

Open Olympiad consists of the most interesting and hard problems that are proposed by a wide community of authors, so we decided to conduct a Codeforces regular round based on it, which will happen on Mar/07/2020 12:35 (Moscow time) and will be based on both days of the Olympiad. Each division will have 6 problems and 2 hours to solve them.

We kindly ask all the community members that are going to participate in the competition to show sportsmanship by not trying to cheat in any manner, in particular, by trying to figure out problem statements from the onsite participants. If you end up knowing some of the problems of Moscow Open Olympiad (by participating in it, from some of the onsite contestants or in any other way), please do not participate in the round. We also ask onsite contestants to not discuss problems in public. Failure to comply with any of the rules above may result in a disqualification.

Problems of this competition were prepared by meshanya, cdkrot, wrg0ababd, vintage_Vlad_Makeev, DebNatkh, dimaskovas, voidmax, okwedook, ch_egor, V--o_o--V, Sender, grphil, mingaleg, KiKoS, Endagorion, Nebuchadnezzar guided by cdkrot, ch_egor, vintage_Vlad_Makeev, GlebsHP, Zlobober and Helen Andreeva.

Problems for second division were prepared by vintage_Vlad_Makeev, ch_egor and MikeMirzayanov, to who we also want to say thanks for the Codeforces and Polygon systems.

Good luck everybody!

UPD1:

The scoring distribution for both divisions is standard: 500 — 1000 — 1500 — 2000 — 2500 — 3000

Due to the official competition source codes of other participants will not be available for an hour after the end of the round.

UPD2: Editorial

UPD3: Winners!

Div. 1:

Div. 2:

• +154

 » 2 years ago, # |   +165 3 years ago? wut?
•  » » 2 years ago, # ^ |   +240 Yeah, this announcement is quite vintage.
•  » » » 2 years ago, # ^ |   -60 Yes, too much vintage. vintage vintage. vintage Petr Mitrichev would be young. haha! :)
•  » » » 2 years ago, # ^ |   +25 oh! so problems would be vintage as well.
 » 2 years ago, # |   0 Hope for no accident!
 » 2 years ago, # |   +1 im ok meme fire!
 » 2 years ago, # |   0 Hope that this round will be much better than this one.
 » 2 years ago, # |   +35 3 years ago :D
 » 2 years ago, # |   -20
 » 2 years ago, # |   -52 Please no mathforces!
 » 2 years ago, # |   +29 Blog post from 3 years ago.Dude I thought my "5 months" were creepy enough. :D
 » 2 years ago, # |   +16 What is the onsite format and how will both days be combined in one round? If the onsite is a 5h contest every day, then joining both in a 2h one seems brutal.
•  » » 2 years ago, # ^ |   0 The are two days, each has 4 problems for 5 hours.
•  » » 2 years ago, # ^ | ← Rev. 2 →   +1 Each of these problems have subtasks, so they may be given I suppose.
 » 2 years ago, # |   -19 Paşa
 » 2 years ago, # | ← Rev. 2 →   -15 The announcement said that this round "will be based on both days of the Olympiad. Each division will have 6 problems and 2 hours to solve them."What does "both" means?A. The problems of two divisions are same problems; B. No problem exists in both division simultaneously;My english is poor. Could anyone help me with it?
•  » » 2 years ago, # ^ | ← Rev. 2 →   -28 .
•  » » 2 years ago, # ^ |   +33 Here "both" means that problems from two days of Olympiad will be used for Codeforces round.Each division will have 6 problems. Some of them are common, some of them are not.
•  » » » 2 years ago, # ^ |   +5 Got it, thx :)
 » 2 years ago, # |   0 Two interesting problem setters in this round are vintage_Vlad_Makeev and Vlad Makeev
•  » » 2 years ago, # ^ |   +61 As you can see, preparation of this contest started a long time ago (preparing most of the problems started even before announcement writing), so some of them we prepared by vintage Vlad Makeev and some by modern Vlad Makeev.
•  » » » 2 years ago, # ^ |   0 preparing most of the problems started even before announcement writingYou mean more than 3 years ago? XD
 » 2 years ago, # | ← Rev. 2 →   +13 Should I prepare my vintage Paint MS for a vintage meme about vintage_Vlad_Makeev , vintage_Vlad_Makeev , vintage_Vlad_Makeev and that other guy whose handle I'm not going to type from my phone?
•  » » 2 years ago, # ^ |   +17 Plz make a meme about yuhao
 » 2 years ago, # |   0 What's the score for each problem?
•  » » 2 years ago, # ^ |   +9 The scoring distribution for both divisions is standard: 500 — 1000 — 1500 — 2000 — 2500 — 3000
 » 2 years ago, # |   0 Can anyone explain how and how much rating increases or decreases depending on what factor ? I read this FAQ from codeforces Codeforces FAQ rating and div link but it is still not clear how much it changes and on what factor?
•  » » 2 years ago, # ^ |   +8 This might be the simplest explanation: Based on your rating before a contest starts, you are given an "expected rank", ie, you are expected to perform that well. If you outperform your expected rank then your rating increases and if you underperform, your rating decreases.
•  » » 2 years ago, # ^ |   0 You can see the formula here. Though it is important, I don't care that much and use CF-predictor with live rating changes instead.
 » 2 years ago, # |   +60 There are 11 Candidate Master among Div.2 registration and 9 Expert among Div.1 registration. When will it be corrected?
 » 2 years ago, # |   -10 Who else checked the date? :p
•  » » 2 years ago, # ^ |   0 me because while solving Problem D.( Present) there is mentioned 8 March.
 » 2 years ago, # |   0 Is this contest rated?
•  » » 2 years ago, # ^ |   +21 Yes, vintage contests are usually rated.
 » 2 years ago, # |   +17
 » 2 years ago, # | ← Rev. 2 →   +92 Schools are like: Taught in Class: Div2 A Solved for practice: Div2 B Homework: Div2 C Exams: Div2 D,E,F
 » 2 years ago, # |   +9 After solving C
 » 2 years ago, # |   0 Why are we not allowed to copy others code in our system to check for hacking? We are only allowed to see others code. Previously we were allowed to copy also (around 7-8 months back).
•  » » 2 years ago, # ^ |   0 Only in edu round, you are allowed to copy.
 » 2 years ago, # |   +17
 » 2 years ago, # |   +6 How to solve Div 2 D?
 » 2 years ago, # |   +48 Problem Div1 B was Info1Cup 2017 XORsum
•  » » 2 years ago, # ^ |   +12 Its a little difficult to understand from the editorial given. Can you simplify the approach to solve this question?
•  » » » 2 years ago, # ^ |   +9 Here is more detailed.
•  » » 2 years ago, # ^ |   0 Yes Exactly the same
 » 2 years ago, # |   +2 How to solve Div2B
•  » » 2 years ago, # ^ |   0 I just search for windows with dimension a*b where a*b = K. I maintained prefix array of both the given array, and searched how many window of dimension 'a*1' are there in array A and how many window of dimension 'b*1' are there in array B. Multiply both the count and add to the final answer. This is O(sqrt(K) * (N+M)) solution.
 » 2 years ago, # |   +36 Hate SpeedForces.
 » 2 years ago, # |   +1 How to solve div2 B??
 » 2 years ago, # |   +44 Thanks for this great problemset, I haven't seen better one on Codeforces in a while.
•  » » 2 years ago, # ^ |   +50 i already told you swistakk as the age passes contests become much and much better as they were in your young days.
 » 2 years ago, # |   +6 How to solve div 1 B. My time complexity was O(n log(n)*log(1e7)) which gave TLE on test case 4.
•  » » 2 years ago, # ^ | ← Rev. 2 →   0 I tried to find for every $k$-th bit how many number are there such that $Bi+Bj$ $mod$ $2^{k+1}$ $>= 2^k$ where $Bi=Ai$ $mod$ $2^{k+1}$. I don't know if this is correct I had some bugs in code.
•  » » » 2 years ago, # ^ |   0 Exactly the same idea..
•  » » 2 years ago, # ^ |   +5 Same problem with me too, I implemented binary search instead of using lower_bound. It is giving TLE on test case 4. People who have used lower_bound did not get TLE. My submission: 72730048
 » 2 years ago, # |   0 How to solve div2 D?
•  » » 2 years ago, # ^ | ← Rev. 2 →   -13 Here is solution I've just found in the internet. Still no idea how to solve. Need to apply some voodoo magic, probably. solutionvector v; int f(unsigned int x) { int r=v.size(),ans=0; for (int l=0;ll && v[l]+v[r-1]>=x) r--; ans^=(r-l)%2; } return ans; } int main() { int n,ans=0; scanf("%d",&n); for (int i=0;i v1,v2; for (int j:v) { if (j<2*i) v1.push_back(j); else v2.push_back(j-2*i); } v.clear(); merge(v1.begin(),v1.end(),v2.begin(),v2.end(),back_inserter(v)); int cnt=(f(4*i)^f(3*i)^f(2*i)^f(i)); ans+=i*cnt; } printf("%d",ans); } 
 » 2 years ago, # |   0 What is testcase 6 in div2C?
•  » » 2 years ago, # ^ |   0 maybe something like 6 ))()((
•  » » » 2 years ago, # ^ |   0 What is the expected answer for that?
•  » » » » 2 years ago, # ^ |   +8 6
•  » » » » 2 years ago, # ^ |   -8 4
 » 2 years ago, # |   0 I have no idea for div2 D!!!
 » 2 years ago, # |   0 How to solve div 2 D? Was looking at a trie based approach but how to handle carries properly?
•  » » 2 years ago, # ^ |   +3 To calculate if there's a carry in n-th binary position you can modify array a, and set bit n and higher bits to 0 in every number. Then after sorting array it is easy to count pairs of numbers with sum of 2^n or more. Pair counting step can be done in O(n), but I used binary search, which is n*log(n), and it worked fine.
 » 2 years ago, # |   0 Did anyone solve with idea that converting to problem for binary array and do some stuff. btw I had something to do so I couldnt continue competing.
 » 2 years ago, # |   0 How to solve DIV 2D?? is it based on calculating freq array of all pair less than o(n^2) if yes then how?
•  » » 2 years ago, # ^ |   0 freq array off all pair can be calculated in o(nlogn) time using FFT but I receive Memory limit.
•  » » 2 years ago, # ^ |   +8 sorry. it can be calculated in o(10^7log(10^7)) time.
•  » » 2 years ago, # ^ |   0 Here is solution I've just found in the internet. Still no idea how to solve. solutionvector v; int f(unsigned int x) { int r=v.size(),ans=0; for (int l=0;ll && v[l]+v[r-1]>=x) r--; ans^=(r-l)%2; } return ans; } int main() { int n,ans=0; scanf("%d",&n); for (int i=0;i v1,v2; for (int j:v) { if (j<2*i) v1.push_back(j); else v2.push_back(j-2*i); } v.clear(); merge(v1.begin(),v1.end(),v2.begin(),v2.end(),back_inserter(v)); int cnt=(f(4*i)^f(3*i)^f(2*i)^f(i)); ans+=i*cnt; } printf("%d",ans); } 
 » 2 years ago, # |   +51 Before the contest: I want to solve Div1 D!After the contest: How to solve Div1 B and C ??
 » 2 years ago, # |   +8 I have never seen a shitty contest like this. The problemset(Div.2) was completely imbalanced. Disgusting!!!
 » 2 years ago, # |   +26 Div2D/1B was copied : https://oj.uz/problem/view/info1cup17_xorsumWould still like to know how did you guys solve it ?
 » 2 years ago, # | ← Rev. 2 →   +74 My solution to B: A sum $s = a_i+a_j$ (w.l.o.g. both $\lt 2^{k+1}$) has a bit $2^k$ set iff $s \ge 2^k$ and either $s \lt 2^{k+1}$ or $s \ge 2^{k+1}+2^k$. For each $k$, use a Fenwick tree to count them. $O(N \log^2)$ with a good constant.C: Consider vertices from the right half. Let's ignore vertices with no edges to the left half. Merge vertices with the same sets of left neighbours. The answer is the GCD of the total weight and weights of all these merged vertices. Complexity: $O(M + N \log)$ with hashing.Proof: consider the answer $g$ and its divisor $d$, which must divide the total weight. Among the merged vertices whose weights aren't divisible by $d$, find one with the smallest degree. If we take all vertices from the left half that aren't adjacent to it, then we take all other vertices from the right half, since all other merged vertices have $\ge$ degree and those with equal degree don't have the same set of neighbours, so their weight (total weight — weight of this not taken merged vertex) is indivisible by $d$.D: There's a reasonably straightforward DP: for each aggressiveness $l$ and each suffix of already chosen candidates, calculate the maximum cost if we have $j$ people that fought and crossed over to aggressiveness $l+1$. This is $O(N^2M)$, but we can notice that the number of people that can cross over to gradually higher $l$ decreases exponentially, so we can remember the maximum $j$ that resulted in a reachable state for each $l$ and suffix. Complexity: $O(ok)$ probably.
•  » » 2 years ago, # ^ | ← Rev. 3 →   +8 Another proof of C would be the following.For a sets $S$, $T$, define $\gcd(S, T)$ as $\gcd$ of sum of elements of $S$ and $T$. We note the following, if $A \subseteq B$ then $\gcd(A, B) = \gcd(A, B - A)$.For two vertices we want $\gcd(N(u_1), N(u_2), N(u_1) \cup N(u_2))$, if $A = N(u_1)$ and $B = N(u_2)$. $\gcd(A, B, A\cup B) = \gcd(A, B, A\cup B - A) = \gcd(A, B, B - A)$ $= \gcd(A, B - (B - A), B - A) = \gcd(A, A \cap B, B - A)$ $= \gcd(A - A\cap B, A \cap B, B - A) = \gcd(A \cap B, A - B, B - A).$Notice that all these are all the sections of the Venn Diagram of $A$ and $B$. We can easily generalize to more sets (just use induction).We effectively have to sum all the nodes that are in the same section of the Venn Diagram. Two nodes are in the same section of the Venn Diagram if and only if, they are in the same $N(u_i)$'s which is the same as saying they have the same left neighbours. $\blacksquare$The dumbass I am, I didn't realize that the problem was trivial from here and managed to not solve it. :'(
»
2 years ago, # |
-167

I don't know what's wrong with this code for Div2 B. It's giving WA on testcase 3. Can anyone please tell my why??

# pragma GCC target ("sse4.2")

using namespace std;

# define time cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";

int main() { fast; lli n,m,k; cin>>n>>m>>k; vector<pair<lli,lli>>vp; for(lli i=1;i<=sqrt(k);i++) { if(k%i==0) { vp.push_back({i,k/i}); if(i!=k/i) vp.push_back({k/i,i}); } } /*for(auto i:vp) { cout<<i.first<<" "<<i.second<<"\n"; } */ vectora,b; for(lli i=0;i<n;i++) { lli x; cin>>x; a.push_back(x); } for(lli i=0;i<m;i++) { lli x; cin>>x; b.push_back(x); }

vector<lli>dpa(n+1),dpb(m+1);
if(a[0]==1)
dpa[0]=1;
if(b[0]==1)
dpb[0]=1;
vector<lli>la,lb;
for(lli i=1;i<n;i++)
{
if(a[i]==1)
{
dpa[i]=dpa[i-1]+1;
}
else
{
dpa[i]=0;
if(dpa[i-1])
la.push_back(dpa[i-1]);
}
if(i==n-1)
{
if(dpa[i]!=0)
la.push_back(dpa[i]);
}
}
for(lli i=1;i<m;i++)
{
if(b[i]==1)
{
dpb[i]=dpb[i-1]+1;
}
else
{
dpb[i]=0;
if(dpb[i-1])
lb.push_back(dpb[i-1]);
}
if(i==m-1)
{
if(dpb[i]!=0)
lb.push_back(dpb[i]);
}
}
/*for(lli i=0;i<dpa.size();i++)
{
cout<<dpa[i]<<" ";
}
cout<<"\n";
for(lli i=0;i<dpb.size();i++)
{
cout<<dpb[i]<<" ";
}
cout<<"\n";
*/
lli las=la.size();
lli lbs=lb.size();
lli sz=vp.size();
lli total=0;
for(auto i:vp)
{
for(lli j=0;j<las;j++)
{
if(la[j]>=i.first)
{
for(lli k=0;k<lbs;k++)
{
if(lb[k]>=i.second)
{
total+=((la[j]-i.first+1)*(lb[k]-i.second+1));
}
}
}
}
}
cout<<total;

return 0;

}

•  » » 2 years ago, # ^ |   +9 can someone tell me how to ask question so that i will not get so many downvotes. I am new to codeforces. THis was my first contest. And i don't know what i did for getting so many downvotes
•  » » » 2 years ago, # ^ |   0 First important thing is to not post long code directly into your comment. Use a link instead
 » 2 years ago, # |   +22 Contest was unbalanced. Difficulty level between C and D was very wide.
 » 2 years ago, # |   +24 The gap between Div2 C and Div2D doesn't nice at all
 » 2 years ago, # |   +42 For Div1 C, I made a randomized solution, which is completely wrong. I submitted it 16 times before it got Pretests passed. So if I count with 1/16 chance to pass 12 tests and with about 96 main tests (8*12), then I have about (1/16)^8≈2*10^(-10) chance to pass main tests, so about 1 in a 5 billion. I like my chances!
•  » » 2 years ago, # ^ |   0 I really wouldn't want to be the one preparing tests for div1C. Not only is it possible to make a correct solution without realising it (see above), it's really easy to make a solution that's almost correct and distinguishing between them reliably is hard.
•  » » » 2 years ago, # ^ |   +38 Oh yeah, it was quite hard to come with idea of strong tests. However there is a test with ~7500 non-zero degrees vertices in left half and exactly one subset of size 5 of vertices that you should handle to find proper GCD and connected graph.You can try to find such test yourself it's a very nice problem.
•  » » » 2 years ago, # ^ |   +8 You can make a solution by simply comparing neighboring vectors by size and elements instead of hashing. But indeed building strong tests for it are so difficult to me. I prefer preparing problems with easy work in generating data ^o^.
•  » » 2 years ago, # ^ | ← Rev. 6 →   0 Mine's a randomised and a bit greedy solution as well. (greedily sorting vertices with several comparators and considering all prefix of vertices as subsets to calculate gcd). It passes systests, submitted after the contest. 72661488Unfortunately I tle'd systests during the contest with the same soln 72655512 thanks to using endl instead of '\n'. T-TGreedy comparators used: Sort left vertices in order of how less connected their right neighbours are to left vertices. Sort by degree.
»
2 years ago, # |
-148

I don't know what's wrong with this code for Div2 B. It's giving WA on testcase 3. Can anyone please tell my why??

# pragma GCC target ("sse4.2")

using namespace std;

# define time cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";

int main() { fast; lli n,m,k; cin>>n>>m>>k; vector<pair<lli,lli>>vp; for(lli i=1;i<=sqrt(k);i++) { if(k%i==0) { vp.push_back({i,k/i}); if(i!=k/i) vp.push_back({k/i,i}); } } /*for(auto i:vp) { cout<<i.first<<" "<<i.second<<"\n"; } */ vectora,b; for(lli i=0;i<n;i++) { lli x; cin>>x; a.push_back(x); } for(lli i=0;i<m;i++) { lli x; cin>>x; b.push_back(x); }

vector<lli>dpa(n+1),dpb(m+1);
if(a[0]==1)
dpa[0]=1;
if(b[0]==1)
dpb[0]=1;
vector<lli>la,lb;
for(lli i=1;i<n;i++)
{
if(a[i]==1)
{
dpa[i]=dpa[i-1]+1;
}
else
{
dpa[i]=0;
if(dpa[i-1])
la.push_back(dpa[i-1]);
}
if(i==n-1)
{
if(dpa[i]!=0)
la.push_back(dpa[i]);
}
}
for(lli i=1;i<m;i++)
{
if(b[i]==1)
{
dpb[i]=dpb[i-1]+1;
}
else
{
dpb[i]=0;
if(dpb[i-1])
lb.push_back(dpb[i-1]);
}
if(i==m-1)
{
if(dpb[i]!=0)
lb.push_back(dpb[i]);
}
}
/*for(lli i=0;i<dpa.size();i++)
{
cout<<dpa[i]<<" ";
}
cout<<"\n";
for(lli i=0;i<dpb.size();i++)
{
cout<<dpb[i]<<" ";
}
cout<<"\n";
*/
lli las=la.size();
lli lbs=lb.size();
lli sz=vp.size();
lli total=0;
for(auto i:vp)
{
for(lli j=0;j<las;j++)
{
if(la[j]>=i.first)
{
for(lli k=0;k<lbs;k++)
{
if(lb[k]>=i.second)
{
total+=((la[j]-i.first+1)*(lb[k]-i.second+1));
}
}
}
}
}
cout<<total;

return 0;
 » 2 years ago, # |   +23 D was much easier than C, in my opinion (just a straightforward dp). Also including isolated vertices in C was pure evil, Took me around a quarter to figure that out :/Btw is the intended solution to E parallel binary search on the value of each index and then some book-keeping of left and right pointer for each index via DSU? If so, it was a bad idea to have it as E since not many would reach it in time (though it isn't much hard).Nice problemset overall.
•  » » 2 years ago, # ^ | ← Rev. 2 →   +21 For me it was the opposite: C was very straightforward, I just looked at when some $x$ divides the GCD, and it was easy to see and prove that this holds when every non-isolated right-side vertex has value divisible by $x$ (assuming every right-side vertex has a distinct set of connections. If they do not, just join vertices with the same connections). I did get one WA from the isolated vertex case though.On the other hand, in D I had to work with this monstrosity: 72679047, which I couldn't optimise and debug in time.
 » 2 years ago, # |   +10 Is it just me or is the TL for E strict? I should have used a fast set instead of std::set.
•  » » 2 years ago, # ^ |   +10 I used multiset, set and segment tree at the same time (for different purposes), 1247 ms on pretests
•  » » » 2 years ago, # ^ |   0 Seems like my implementation has a bad constant. My solution runs in 3sec on my machine (which is a bit faster than CF), and with fastset it runs in 1sec.
•  » » » » 2 years ago, # ^ | ← Rev. 2 →   0 Ok mine is too slow too :(
•  » » 2 years ago, # ^ |   +58 n log n, TLE systests, byebye
 » 2 years ago, # |   +5 How to solve div1C?
 » 2 years ago, # |   -17 Good Balance!
 » 2 years ago, # |   +34 Div2 D/ Div1 B — https://atcoder.jp/contests/arc092/tasks/arc092_b
•  » » 2 years ago, # ^ |   0 As the editorial, my O(NlogNlogMAX) time solution get TLE, maybe my implementation is not optimal enough. By the way, if I use int instead of int_64, I get wrong answer on the same test case, which means within time limits.
 » 2 years ago, # |   -56 WTF , my comment got deleted ...
 » 2 years ago, # |   +9 Amazing problems, thanks for them!
 » 2 years ago, # |   +8 Btw, statement of F was TERRIBLE, it got so many stupid things I am not even gonna point them out, cause it would take me too long
 » 2 years ago, # |   +9 For Div2, Over 2k solutions for C, and about 100 for D. Quite a shift though
 » 2 years ago, # |   -17 I Hate SpeedForces :(
 » 2 years ago, # |   +18 Good problemset, but as I suspected squishing a 2-day 4-hour(?) contest into a single 2h round is just gonna make it too difficult.
•  » » 2 years ago, # ^ |   +46 Yeah, it's quite sad that nobody had time for F, I like this problem very much :(However we dropped some hard problems from original competition to make this contest more solvable, but probably 0.5-1 extra hours were probably required.
 » 2 years ago, # |   +18 Why is this solution to 1C getting TLE on test 72？linkIt seems many other people got TLE on the same testcase.
•  » » 2 years ago, # ^ |   0 "Due to the official competition source codes of other participants will not be available for an hour after the end of the round."Wait a bit or paste the code to somewhere else, if you want to get an answer.
•  » » » 2 years ago, # ^ |   +1 Probably sensible to not paste code somewhere else as that kind of defeats the purpose of making codes not available. Just wait.
•  » » » » 2 years ago, # ^ |   -30 A rule that can be broken without repercussions is useless.
•  » » 2 years ago, # ^ |   0 It seems I'm getting TLE due to std::cin. Why such a tight TL... Or is it intended to fail solutions with slower I/O?
•  » » » 2 years ago, # ^ |   0 You are probably just doing it wrong. Using endl or sth like this. It's never an intention to fail solutions with iostream since it is not slower than cstdio when used properly.
•  » » » » 2 years ago, # ^ | ← Rev. 2 →   0 Then how to use iostream "right"? I've done nothing but to replace std::cin>>a[i] with scanf("%lld",&a[i]) and it passed.
•  » » » » » 2 years ago, # ^ |   0 ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);.And '\n' instead of endl.
•  » » » » » » 2 years ago, # ^ |   0 Thanks,it passed after doing this.
•  » » » 2 years ago, # ^ |   0 Yes, I already replaced "cout<
 » 2 years ago, # |   +11 After long time i will reach on specialist.Thank you codeforces .
 » 2 years ago, # | ← Rev. 3 →   0 So all the pretests in Div1B are either $n$ is even or $a_1\oplus a_2 \oplus a_3 \dots \oplus a_n=0$... lol
 » 2 years ago, # |   +1 Pretest is weak?
 » 2 years ago, # |   +49 The most important part for Div.1 C is not to use std::endl.
•  » » 2 years ago, # ^ |   +10 Why does it matter so much? You're printing one integer.
•  » » » 2 years ago, # ^ |   +10 I thought so too during the contest. But it has multiple test cases.
•  » » » » 2 years ago, # ^ |   -26 7
•  » » 2 years ago, # ^ | ← Rev. 2 →   0 Even if one uses the standard ordered map for storing vectors, no problem. Just the "cout" is the problem.
 » 2 years ago, # |   0 when we get a rate?
 » 2 years ago, # |   +9 My solution for Div 1 A shows Pretest passed and I did not get any points for it. Does it mean it failed system test or something else? It is weird..
 » 2 years ago, # |   -8 Will I get minus if I got wrong answer on pretest 1?
•  » » 2 years ago, # ^ |   0 No penalties for solutions failed on (pre)test 1
•  » » » 2 years ago, # ^ |   +1 I know about NO PENALTIES. But what about getting minus?
•  » » » » 2 years ago, # ^ | ← Rev. 2 →   0 You mean something like "-1" "-2"("tried" counter)?Failing on (pre)test 1 won't be counted in the "tried" counter
•  » » » » » 2 years ago, # ^ |   +1 Forget about it. I already got minus in rating.
•  » » » » » » 2 years ago, # ^ |   0 You mean rating change?I didn't understand it :( sorry for inconvenience
 » 2 years ago, # |   +9 Being a master was truly magnificent experience.Au revoir!
 » 2 years ago, # |   +24 I took part in Codeforces Round #626 (Div. 1, based on Moscow Open Olympiad in Informatics) just now. I passed the pretest of problem A. But the system didn't send my solution into system test. Why does this happen？
•  » » 2 years ago, # ^ |   +16 Same with me :(
•  » » » 2 years ago, # ^ |   +5 Are you extra registration?
•  » » » » 2 years ago, # ^ |   +8 Yes!
•  » » » » » 2 years ago, # ^ |   0 I am extra registration too. And did you use m1.codeforces or m2.codeforces.com or m3.codeforces.com?
•  » » » » » » 2 years ago, # ^ |   +8 No i used codeforces.com, the reason seems to be extra registration.
•  » » » » » » » 2 years ago, # ^ |   0 I suddenly accepted. It really confused me.
 » 2 years ago, # | ← Rev. 5 →   -35 My submission 72636993 got a TLE during system testing. Submitting the same exact same code does gets an AC!! Also the TLE was on test 5 wasn't it already included in the pretests??The submissions:72661261The below submissions I just added another variable x, just to bypass submitting the exact same code twice. Other than that there is no difference in the codes.726610817266115972661597Submissions image
•  » » 2 years ago, # ^ |   +12 Your solution works quite close to time limit. There are always some fluctuations in program working time, so it's just a bad luck that your submission got TL on system tests.
•  » » » 2 years ago, # ^ |   0 Thanks for the reply.
 » 2 years ago, # |   +4 How come my code for B fail at test case 5 ,which was already present in pretests.
•  » » 2 years ago, # ^ | ← Rev. 2 →   0 The execution time may be different in runs.If your code consumed almost 1000ms(e.g:996ms) in the pretests, it's probably to fail in the main tests.
•  » » » 2 years ago, # ^ |   0 Hello, you know when the rate change?
•  » » » » 2 years ago, # ^ |   0 in several hours? no one knows the exact time.
•  » » » » » 2 years ago, # ^ |   0 Oh :( , thanks
 » 2 years ago, # |   +150 Okay, I will say it. The pretest for Div1 C is fucking garbage.I passed pretests using only 580ms. The time limit is 2s. My solution is deterministic, and runs in basically the same time given that the input size is fixed.It got TLE on test 72.I then changed from cout << ans << endl; to cout << ans << '\n';. It now runs in 800ms.It means that it takes at least 1.2s to flush 500000 times, which implies there is no such test where $t = 500000$ in the pretest (I really doubt the maximum $t$ in the pretest is even close). Now I'm pretty sure that Codeforces has the policy on problems that the pretest must satisfy i) it contains all corner cases on which some known solution fails and ii) all parameters specified in the problem must hit their respective maximal values. With that knowledge, I put my trust in the problem setters that they have at least complied with the policy and believed that Codeforces actually could handle 500000 flushes better than I thought. Turned out I was wrong on both, LOL. It would be really great if anyone involved can explain the thought process (or lack thereof) behind the decision not to put such tests in the pretest.
•  » » 2 years ago, # ^ |   -67 So you knew that flushes could be a problem, but decided to use endl anyway, hoping that jury will comply with some imaginary policy that noone except you knows? Seems like you got what you deserved.
•  » » » 2 years ago, # ^ |   +99 Not including all "simple" types of max tests (and I believe $t=500\,000$ is one of them) is a questionable decision, especially considering that large $t$ might be here for a reason. For example, my first idea involved factorizing a number as large as $10^{12}$, which is pretty hard when you have to do it $t$ times within 2 seconds.
•  » » » 2 years ago, # ^ |   +78 I did not know how long it takes for Codeforces to process that amount of flushes. I used flushes to debug my solution locally, and forgot about it. I submitted the solution, saw that it passed within 1/3 of the time limit, and was completely convinced that it would not be that big of a problem.I didn't say that I deserved to pass using 500000 flushes; however, if such tests were present in the pretest, I would have known immediately what the issue was. For the "imaginary policy" part, feel free to enlighten yourself. Some quotes taken from the document: Always make tests (at least) with minimum possible, maximum possible and some value in between for each variable and their combinations. In general, pretests should include: a test with maximum size of input (e.g. maximum n), a test against integer overflow, a few random small tests. There should be no warnings in polygon, except (if reasonable) "there are tests with input/output for statements [without TeX marks]". ("parameter 't' does not hit maximal value" is one such warning). I have involved in preparing some Codeforces rounds, I know what I am talking about. I don't pull facts out of my ass. Have a nice day.
•  » » » » 2 years ago, # ^ |   -43 First and third points are about all tests, not pretests. Second point only implies that there should be a pretest with sum of $n$ equal to $500000$. Still don't understand why would you expect pretests to be perfect.
•  » » » » » 2 years ago, # ^ |   +34 FYI, here is a screenshot taken from Polygon: As you can see, the system does warn about pretests being incomplete. In fact, if you insist on trying to nitpick things, the test with $t=500000$ and $n=1, m=1$ for each case also gives the maximum input size possible (about $1$ million more integers to read), therefore it should be included in the pretest (this is rather redundant, since the third quote already pointed that out anyway).
•  » » » » » » 2 years ago, # ^ |   -74 OK, authors are wrong. But still you relied on something that is not written in the rules (for contestants) and got punished. Seems right.
•  » » » » » » » 2 years ago, # ^ |   +47 Yeah I mean people also expect each other to not tell a dick joke at the funeral, even if it's not written in the rules, and will be upset (rightfully so) if one does.But fair point I guess. Sorry for the bad analogy.
•  » » » » » » » 2 years ago, # ^ | ← Rev. 3 →   +26 Ignore: in prev version Russian colypasted joke
•  » » 2 years ago, # ^ |   -23 the same situation happened to SeehtEntity. You can consider it as a good experience :3
 » 2 years ago, # |   +4 I guess B and C got swapped :(
 » 2 years ago, # |   0 so sad, this sentence "Then output k distinct integers (1≤pi≤n), indexes of the chosen elements" in div2 A, Let me misunderstanding, i think it's k distinct integers a[i], not the index of a[i].
 » 2 years ago, # |   0 Why I can't see solutions of others? Help me with Div2 D. How to solve D.
 » 2 years ago, # |   +3 Unfortunately, Problem Div.1 B coincides with atcoder ARC092D.. TAT But it's nice problem anyway.
 » 2 years ago, # |   0 There is a small typo in the input section of the problem statement of the problem Div.1 D.
 » 2 years ago, # | ← Rev. 2 →   +3 Finally this code got TLE on test 72... 72676139To solve this problem,I use gets lol 72676564
 » 2 years ago, # | ← Rev. 2 →   0 Can anyone please tell me why this submission (for Div 2 B) gave run time error on TC 34, as on my compiler, for same case it gives the expected output 0 as answer? https://codeforces.com/contest/1323/submission/72650213
•  » » 2 years ago, # ^ |   0 in your solution problem is with this statement " i=v.size()-1 " here v.size() is unsigned integer. make sure to convert it into int before using it like this "i=(int)v.size()-1".
•  » » » 2 years ago, # ^ |   0 Thank you. That was the issue.
 » 2 years ago, # |   +1 Can someone explain div1D because I can't get much of what the editorial is saying?
 » 2 years ago, # |   -14 Div 2 was shit first 3 very easy and other all was out of mind #fuckedup
 » 2 years ago, # |   0 zhouyuyang congratulations for rank 1.
 » 2 years ago, # |   +3 Wish Codeforces could be better and better.