Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
# | User | Rating |
---|---|---|
1 | Um_nik | 3459 |
2 | tourist | 3438 |
3 | maroonrk | 3359 |
4 | ecnerwala | 3347 |
5 | Benq | 3317 |
6 | ksun48 | 3309 |
7 | boboniu | 3300 |
8 | Petr | 3293 |
9 | Radewoosh | 3289 |
10 | TLE | 3223 |
# | User | Contrib. |
---|---|---|
1 | Errichto | 206 |
2 | Monogon | 194 |
3 | SecondThread | 191 |
4 | pikmike | 187 |
4 | antontrygubO_o | 187 |
6 | vovuh | 185 |
7 | Ashishgup | 181 |
8 | Um_nik | 180 |
9 | Radewoosh | 169 |
10 | pashka | 167 |
Name |
---|
Solution of G with maxflow idea.
http://codeforces.com/contest/978/submission/38193150
Nice!
I also solve it with maxflow like an assignment problem. 38199894
Very fast! Thank you
Thanks for quick explanation. Is there any solution which works faster than "brute solution" for problem D?
Faster than O(n)? I think, no.
We need to iterate over massive in cases of changing first and second elements. So as our first element could be changed in 3 ways and second element could be changed in 3 ways we have O(n*m) where m = number of combinations of first and second element changes (in our case 3*3). Maybe my question was not clearly. Is there any way to generalize algorithm to work not only with changes between [-1, 1] but also with general case [-i, i] not in O(n*m) complexity?
even 5 ways: a1-a2, a1-a2(+-)1,a1-a2(+-)2
Hello! I've solved it by calculating an average value of the common difference. But there are tricky cases when n equals 4 or 5. 38261362
For G you don't need to iterate all the exams every day.
38195700 complexity is O(n*logm) insted of O(n*m)
Excellent thanks for posting
A simple way of understanding 978E - Система видеонаблюдения в автобусе:
Define pre[i] =
Let's take an arbitrary variable initial which could hold all possible initial values.
It is easy to see this inequality holds true:
0 ≤ initial + pre[i] ≤ w,
Which implies:
- pre[i] ≤ initial ≤ w - pre[i]
We can reduce this to:
max(0, - pre[i]) ≤ initial ≤ min(w, w - pre[i])
Solving this inequality and finding the range gives us the final answer.
For F instead of using vectors with quarrels another nice way is to process the quarrels by incrementing an array containing the "number of quarrels with less skilled programmers". Then we can just directly subtract the number in that array at the end.
My solution 38178463 to problem 978E - Система видеонаблюдения в автобусе is O(n).
My solution 38166452 to problem 978B - Имя файла was similar to the one in the tutorial, but easiest, it's how many ocurrences have the string "xxx" in the string s.
fcspartakm I think there was a typo in the tutorial of problem F: "we can user array of pairs" for "we can use array of pairs".
Regexp solution is very easy to write for B :P
Problem E can be solvable using binary search on answer . :) . 2 times binary search , first for negative upper bound , second for exceeding lower bound .
Other "different" solution for the problem F is using BIT compressed
In problem 978D: "Almost Arithmetic Progression" I'm failing in test case 17. 3 34 70 52 But this is already an AP. The answer should be 0. But the jury's answer for this is -1. Please help where I am mistaken.
My solution: https://codeforces.com/contest/978/submission/38594533
I got my mistake.