0
Is there any difference between submitting code with commented solution of other problem in it and pasting it in an open blog ( or social media, IDE, etc. ) ? 
0
When will you announce random Tshirt winners? 
+1
Dear contest team, I received a message that two of my solutions (B, D) significantly coincide with what user "gamegame" submitted. If you take a look at them, they are significantly different, especially D. I wrote and compiled my code locally without using any online resources. This round was my best contest in years, and I would be very sad if the rating changes were rolled back even though I didn't share my code with anyone or copy gamegame's code in any way. 
0
omg, how haven't I seen this?) 
0
Dear contest team, I received a message that two of my solutions (A, B) significantly coincide with what user "V_e_N_o_M" submitted. This cannot be a coincidence as I use some nonstandard patterns in the code, which differentiate it from what people normally do. With that I can clearly see that V_e_N_o_M used my code. If you check the time of the submissions, you will see that I am the original author. In addition, other submissions of mine can be checked — they are very similar and follow the same patterns. I believe that the code was taken by "V_e_N_o_M" from my GitHub repository — https://github.com/sgrade/cpptest/commit/3c7913c2e07176e092cb5b75544b0671ffc88e90 I submitted the code to Github before the end of the contest. Apologies for that — I will make sure it won't happen again. P.S. I also saw that a user with nickname "__VENOM___" did such things before (see the comments to https://codeforces.com/blog/entry/8790). 
17
Dear MikeMirzayanov, Dormi, I think there is a coincidence in my submission of C, F1 for the latest contest. During the contest, I was just using my own compiler and not using any thirdparty platform to communicate or use the online compiler. So I hope you will see my comment and thought about this again. Also, you can see that the code is a bit similar because I use global(wellknown) method for coding, that's why it's kind of similar, I don't know how does dakwamim code is the same as me. I am currently using Code::Block for coding and save it locally. P/S:Thank you for reading my messages. 
0
Nice idea to escape using too much space. Really liked that sorting idea! I never thought of using that to make the code simpler! Thanks for the help! 
+13
the author 
+3
Can anyone please tell me what is wrong with my code 119381067 
+13
This 3 changes need , actually for ask query format should be like "? x"... 
0
Still don't understand why my solution on D catches: "Idleness limit exceeded on test 1". I even do cout.flush() after endl. Can anyone help me? My last submission: https://codeforces.com/contest/1534/submission/119510328 
+3
In my C solution 119368225, the array formed of upper/lower pairs simply gets sorted by the value of the upper element in each pair (since this doesn't change the answer). After this is done, the upper elements became the identity permutation and the bottom elements became a derangement of it. The rest is the same. The only difference is that my solution has $$$O(n \log n)$$$ time complexity because of applying sort. And yours is a smarter $$$O(n)$$$ solution, achieving the same end result. My reasoning was "let's sort the input data and see if the problem becomes more simple" and indeed that's what happened! I overlooked the fact that this degraded time complexity, but humongous sizes of the input data typically have i/o as the performance bottleneck (to the extent that C++ people are forced to use the sync_with_stdio voodoo magic). While sorting the input data rarely or even never becomes a real performance problem. 
+6
You could simply use "assign" instead of "resize" and you won't have to worry about global variables. 
0
probably You :)) 
6
I love the way how i went to learn from tourist by looking at his code , and returned even more confused 
0
Really liked C. I am not sure if this was already commented by someone on problem C, but here is what I did. Let the first row be the permutation $$$a$$$ and let the second row be $$$b$$$. We have the property that $$$a_i \ne b_i$$$ for all $$$1 \leqslant i \leqslant n$$$. Now, since this does not change the answer, apply the permutation $$$a^{1}$$$ on both arrays.(by this I mean changing indice $$$i$$$ to $$$a^{1}_{i}$$$) Now we have the identity permututaion and some derangement of it at the bottom. Let this derangement be $$$c$$$. Note that $$$c$$$ is equal to $$$b \cdot a^{1}$$$. The important observation is that if you swap $$$i$$$ with $$$c_i$$$, then continuing you must swap $$$c_i$$$ with $$$c_{c_i}$$$ and so on until you "cycle" back to $$$i$$$. This inspires to think of the cycles in the permutation $$$c$$$. So, if there are $$$X$$$ cycles, we have $$$2$$$ possible states for each of them. Either you go through that cycle once or you do nothing.(note that going through a cycle brings you back to where you started). Thus the answer is $$$2^{X} \pmod {10^9+7}$$$. So, we can say more about the graph in the tutorial, each vertex has degree $$$2$$$. 
0
First, rephrase the whole thing as: you've got a directed graph where some vertices are marked (the $$$a_i$$$th sand in $$$i$$$th column), find the smallest set of vertices such that each marked vertex is reachable from at least one chosen vertex. I compress to DAG, note that only topmost components should be chosen, then note that from the way the graph is constructed, no two topmost components can share a column, so they're easy to sort. Also, paths in the graph are actual paths in the grid, so the set of topmost components from which a given vertex/component can be reached is a contiguous interval. With a simple graph traversal, for each component, I find the leftmost and rightmost of the top components which are above it (minimum and maximum of their numbers in sorted order) and the problem reduces to picking the smallest number of points that cover all given intervals, which is wellknown. 
0
Thankyou so much for taking out the time to look into this and getting back to regarding the issue. I definitely learnt something new today. I understand why this happened now. Have a nice day :) 
+18
Mark vertices that you need to cover, make scc, mark respective vertices in scc, unmark those that are reachable from another marked. Now you have set of marked vertices none of which is reachable from the other. I claim that you can sort them in some order that any source in SCC will cover segment of marked vertices, just sort them by column id of any marked representative in scc vertices. Now you have to figure out minimum and maximum reachable marked vertex from each source and cover array with minimum number of segments, which can be done greedily without actually finding segments: take first unmarked vertex, go through back edges and mark every node as visited, from each marked node go down and mark all nodes as visited as well. You will reach all sources that cover first marked vertex, which is precisely what greedy on array does. Then take next marked unvisited vertex and so on. 
0
congratulations winners 
+3
Do you mean that somebody uploads their solution for A instead of a solution for B by mistake? But a solution for A is very unlikely to pass pretests for B. And it makes no sense to show the source code of failed submissions to hackers (I don't know if that's how it really works, because I have never tried hacking other solutions in noneducational rounds yet). Or do you mean that somebody submits a valid solution for B, together with a commented out solution for A in the same source file? Is anyone ever doing something like this? I do sometimes use my A solution's source code as an initial template for B. But by the time when I'm ready to submit it, no parts of A remain there. 
0
Thanks a lot 
10
congrats for all the winners and I hope one day I can compute at you're level 
+2
Make the arrays bigger, e.g. An array 
0
Thanks for the information. Is there any way to overcome this error? 
0
this is what i did :) 
0

0
how's the new macbook benq!lol 
0
I thought there should be a natural extension in F. So I continued with the SCC formulation and reduced it to finding a minimum size set of vertices in a DAG such that every leaf is reachable from some vertex in the chosen set. Then I tried to solve it with some (wrong) flow models. Does anyone know if this problem admits a good solution in general? 
20
I'm not the lowest:) 
20
become newbie! 
0
What’s your solution then? 
23
Mythical Grandmaster or Chimeric Grandmaster. Chimeric Master for 40005000 and Mythical or Chimeric Grandmaster for 5000+ works. 
6
You may get it after removing cheaters, Congratulations! 
+5
When your local submissions behave differently from codeforces submissions, it often indicates that your code may have undefined behavior. In your case, I think you are trying to access an element out of bounds of the 
+13
Waiting for the +1. I want the IM. 
+12

0
In practice mode (i.e. after the contest), runtime errors on codeforces can be caught by the C++ diagnostics compiler automatically. I resubmitted and it shows that your char arrays 
+5
its just another way of checking it* 
0
Thank you, that was the problem, I can't believe that was the reason, well now I will never forget about that lol. Thanks for your help! 
0
It would still give chesslike board 
+78
To not keep you waiting, the ratings updated preliminarily. In a few hours/days, I will remove cheaters and update the ratings again! 
+5
Neither of them. 
0
You can also implement bfs or dfs and color the graph while doing so. Not that it would be better, but it also works. 
+19

0
ah, I'm blind, sorry, you don't fill it with zeros for every testcase, that's the reason, it is global 
0
Well, I used SCC and didn't have to erase and rewrite, so I think it was a good path to take. 
+8
I made a few little changes in the cases where n = 1 and n = 2, and it passed: 119404096 
0
I gave hist a size of 4 * 100005 which is 4 * (1e5 + 5) so that shouldn't be the problem. Also, I just tried with hist[(int) 4e6] and again got WA on test 4. 
0
can some one tell why I am getting WA on this submission my friends solved literally the same idea and they got AC I literally can't find any wrong I am getting wrong on pretest 2 my program is printing 01234501234512345623456734567845678956789100 how can the program prints smth like this plz help https://codeforces.com/contest/1534/submission/119401086 
0

0
good to be back 
+10
Well, I took my code to F2, erased the whole thing with SCC, did some obvious stuff and it worked, so I don’t find SCC useful here at all. 
0
Hi. Can someone explain me why I got WA on test 4 in B? The idea is correct but I can't find the mistake in my solution. Thanks 
+8
I finally found a problem with a good upgrade in this F. Not like F1 has an interesting idea, just a straightforward "build graph, do SCC", where the main point of failure is building the graph in a wrong way, but there's an element of double checking — if F1 passes, you can expand on it to solve F2, while if your SCC is wrong and pretests for F1 don't catch it, then pretests for F2 might because it's way more than SCC! There's a good reason to go for SCC in F2 even if you don't have F1. As soon as you have it abstracted as a directed graph, compressing to a DAG gives you plenty of guarantees for the next step — actually figuring out the solution. It's not hard to write either, just reproduce those 20 lines of Tarjan from whichever online resource you want. 
0
https://codeforces.com/contest/1534/submission/119344612 Why did this fst? Can't seem to figure out. Edit > Don't use global variables when you don't have to. 
+36
Benq has raised the bar of highest cf rating to 3796 now. Beating Tourist . Congratulations Benq. 
0
119382434 Can someone tell me why I'm getting runtime error? 
+1
I found a way, just go to the status bar and check all rejected submissions keeping the tests greater than the number of pretests. 
Created or updated the text 
+10
Two questions: F: Does anybody remember a similar situation when solving a small version and then trying to upgrade it was a mistake? Normally it's rather a good way, but there the small version required only SCC while the big one doesn't (which may lead you to really long code). H: Isn't an interaction with $$$10^5$$$ flushes rather slow/dangerous/generally not CFfriendly? 
13
They will never show that as people will backfire for weak pretests. Although this contest had strong pretests. No one on my friend list got FST. 
0
In your solve function, for clearing the g[i], i should be from 0 to n, i.e., for(int i=0;i<=n;i++) (you did i<n instead of i<=n) 
+13
Looks like highest rating record on codeforces is going to be broken. 
0
+1 
+20
Thanks for the great problems and strong pretests! 
0
https://codeforces.com/contest/1534/submission/119394653 Can somebody try this out on their machine. I submitted this in contest and it gave WA on pretest1 and i tried it on my machine multiple times and it worked well. I'm really frustrated as I don't understand how the same code in 2 machines can give different output (my strategy isn't random, the program will always query the same nodes for a particular tree everytime it runs). 
0
Sorry I just realized my question was utter nonsense. I was asking how this didn't become $$$O(n ^ 2)$$$ even though degree could be upto $$$O(k)$$$ per node. I forgot $$$n \leq 500$$$ in the problem. 
+12

8
Now it's time to wonder if I got a great place thanks to competing drunk or despite competing drunk. 
+2
Failed system test 
+1
Padding the array with one extra 0 element in the beginning and one extra 0 element in the end removes the need to handle special cases. 
0
What is FST? 
0
The query format differs from what you print here. 
+1
Here was my approach: Arbitrarily choose some node to be the root. Query that node. That gives you the rank of each node in the rooted tree. Our goal is to find the parent of each node. Iterate over the nodes in any order. Query each node whose parent is not yet known. We can use the result of the query along with the rank information to find that node's ancestors, siblings, and children. Notice that if we associate each query with the node and its parent, these pairs don't overlap. This proves that we won't exceed $$$\lceil\frac{n}{2}\rceil$$$ queries. 
0
Please can you check my submission 119395523? I calculated 2^(connected comp) but it's giving WA on tc4. 
0
I mean, there is no other solutions 
0
Yes, I didn't notice the announcement first. I felt really dumb noticing it after few minutes. 
+8
Fst on D coming :( 
+13
You are right :) 
0
you can check editorials https://codeforces.com/blog/entry/91760 
+3
I spent half an hour, read several times, and don't understand what it means by "only by swapping numbers in a column". and finally I ask a question to admin, and then I got it. 
0
2^(Cycles) is the answer 
6
Finally Tutorials are here. I was thinking of finally offering some goat to the devil. Thanks to problem setters for fast update. PS: BEFORE YOU COMPLAIN NO TUTORIAL TO BE SEEN IN THE BLOG. TRY TO FIND IT FIRST 
+5
This is the intended solution. 
0
Were your queries more than N/2? 
0
Yes, basically all connected components will be pure cycles 
+9
What if i tell you, that in problem A you just need to check whether given matrix satisfies:
or
Realized this in postcontest discussion with my friend. 
+6
Is there a way to see how many people failed system test for a particular problem ? 
0
will the number of cycles and number of connected components be equal in C? 
0
i could't submit D even after solving it cuz even though i saw a sample problem of interactive problem i could not submit it without idleness, please hack my account and put me out of my missery , basically i am under water its too much raining 
0
i literally did the same thing but got WA in pretest 2 :( . :(:(:((((((((((((((. 
+5
Because admins hasn't made solutions public yet. 
+75
Big ups to the authors for the nice problems, and bigger ups for including the answers to the possible sample queries in the interactive problems where it's reasonable. That's such a nice thing to do <3 
0
I was thinking the same. Clicking on solutions, but nothing is happening. 
0
You can use cf predictor extension. It gives the real time Delta changes during the contest. Just Google it 
0
Consider the i, i — 1 and i + 1 position. 
+4

0
The subproblem I generate to consider problem B i guest? 
0
use cf predictor chrome extension 
Name 
