| # | User | Rating |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | Kevin114514 | 3659 |
| 3 | jiangly | 3640 |
| 4 | turmax | 3450 |
| 5 | tourist | 3382 |
| 6 | strapple | 3360 |
| 7 | Um_nik | 3354 |
| 8 | squareOf105 | 3348 |
| 9 | maroonrk | 3312 |
| 10 | idontwannadothis…e | 3191 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 155 |
| 2 | nik_exists | 151 |
| 3 | maspy | 149 |
| 4 | AmShZ | 145 |
| 5 | Um_nik | 143 |
| 6 | Errichto | 139 |
| 7 | BledDest | 136 |
| 8 | adamant | 134 |
| 9 | maroonrk | 132 |
| 10 | cry | 130 |
|
+1
i too missed that when b+1 > 10^9 :(. |
|
0
Answer for +-- is 6 not 3. EDIT: You encounter '+' as the first character and break the loop, so your answer = n = 3. You should be getting '3' locally too. |
|
0
It can. |
|
+5
The case here is that the solution was failing on pretests but got If you say that's the point of hacking phase then i guess there would be no sense in having strong pretests itself or having pretests for that matter. but its like said here since number of people for which its unfair is small the round should/could still be rated. We just have to wait for an official announcement on this matter. |
|
0
He probably meant to say O(1) extra space. |
|
0
Have all the submission's been re-judged after the hacking phase? it doesn't look like it. |
|
0
have there been such cases before? (where checker had some issues during the contest so contest was made unrated) |
|
0
True, lesson learned — read twice code once. it was tough to see what the question meant once i was sure answer would be n or n-1 or -1. |
|
0
Looks like the same issue i mentioned here |
|
0
Hey kindly read the first post again. not swapping the type is the question solved in the editorial and the 'actual' question. |
|
0
swap (42, 1) and (45, 1) according to process shown above. and then swap (48, 0) (45, 1) end result (25, 1) (42, 1) (45, 0) (48, 1) array is sorted. Think a bit on it, try it out on a paper. its possible to swap and a and c of same type using b of different type. so the solution will always work. |
|
+1
To add - lets consider (45, 1) (25,1) (421,1) (48, 0) You can swap the first two using 48,0 like i mentioned before in the above post. it wouldn't affect (48,0) so we have (25, 1) (45, 1) (421, 1) (48, 0). and now swap (48,421) leading to final sorted array (25, 1) (45, 1) (48, 1) (421, 0) Try it out on paper for various cases. it is as the editorial stated. since even if types are swapped it is possible to swap(a,c) of same types if we have b of different type. so the ans would be 'yes' if such a b exists. else we check is its already sorted or not. |
|
+1
i didn't get what you are trying to say. isn't it already sorted? 25 45 48 421. |
|
0
According to the problem statement we do not swap the type too. meaning type is bound to the element (does not get exchanged when swapping). but lets say we have to swap the types even, even then if we have atleast one element with a different type. lets say elements
If we want to swap a and c of the same type. we can do the following swap(a,b) -> (a t2 j) and (b t1 i) swap(b,c) -> (b t1 k) and (c t1 i) swap(a,b) -> (b t2 j) and (a t1 k) so finally
a and c have swapped positions while b remains same, in the end we swap b to its correct place and thus the element would be in sorted order. Conclusion — It doesn't matter if type's are swapped or not. |
|
0
time limit is 2 seconds. (500)^3 = 1.25 * 10^8 |
|
0
basically 'curr' is obtaining the number of shifts required for element at ith position to match. and then its frequency is being stored. then in the above part of code the maximum frequency is obtained and is the answer. |
|
0
if you check separately for each G then it will lead to TLE since worst case lets say there are approximately n*m G's. (can ignore the -1 due to last being '.') Now dfs/bfs from each vertex would take approx n*m*4 steps. so it would lead to net worst case time complexity of t*n*m*n*m*4 which would take >1 second. I had made the same mistake initially. What you can do is just perform dfs/bfs from n,m and then check if each 'G' vertex is visited. |
|
+6
Its probably due to the overhead of vector being copied each time your are calling your dfs function. Check the below submission, i changed your code to passing by reference and it got accepted https://codeforces.me/contest/1365/submission/82885046 |
|
+6
You are applying dfs from every good vertex. worst case it would take >1 second. What you can do is just do a single dfs from n,m and then check if every good vertex is visited and bad isn't like stated in the editorial |
|
+2
consider 1 3 4 2 0 1 1 1 |
|
+1
ai XOR possible_value_of_k could be a greater value than 1024, i made the same mistake, realized it after i got the RTE. |
|
0
Test 3 — 10 2 2 4 3 2 2 13 13 2 2 9 11 2 1 14 5 2 1 13 2 2 2 4 5 2 1 11 14 2 2 15 3 2 2 12 10 2 2 13 12 n!= 1 anywhere. i think you might have read the testcase incorrectly. Thw lowest case is n=2 for which answer would be -1. |
|
0
Constrains were changed mid-contest, m<=n was enforced meaning your input is invalid. |
|
0
We were picking the cities with min cost, then comparing its cost with cost if it was connected with any of the taken cities. This fails since like in the above test case. |
|
+3
I Had made the same mistake, found it by trying one of the later test cases. Try the following test case 6 802169 415058 438621 719382 427378 361095 938841 703007 651689 546630 543902 45803 928313110 402257489 40475518 321650025 335526487 752229521 91 19 18 39 15 99 Correct answer:- 171488866 |
|
0
Thanks for this, didn't know about it. |
| Name |
|---|


