| № | Пользователь | Рейтинг |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | turmax | 3559 |
| 6 | tourist | 3541 |
| 7 | strapple | 3515 |
| 8 | ksun48 | 3461 |
| 9 | dXqwq | 3436 |
| 10 | Otomachi_Una | 3413 |
| Страны | Города | Организации | Всё → |
| № | Пользователь | Вклад |
|---|---|---|
| 1 | Qingyu | 157 |
| 2 | adamant | 153 |
| 3 | Um_nik | 146 |
| 3 | Proof_by_QED | 146 |
| 5 | Dominater069 | 145 |
| 6 | errorgorn | 141 |
| 7 | cry | 139 |
| 8 | YuukiS | 135 |
| 9 | TheScrasse | 134 |
| 10 | chromate00 | 133 |
|
+1
Yes, you are right. Sorry for the typo. :( |
|
+1
It seems that a lot of people are asking so I have updated the article to include it as the 4th example. |
|
+11
Yes, you are right. Still, for the sake of argument, one would need to show how to compute that in $$$O(1)$$$, which is basically what I was doing below. :) |
|
На
Nisiyama_Suzune →
[Reference] Github reference project for ICPC contests/programming contests in general, 7 лет назад
+44
It is more about compressing the code to fit in the page limit in a typeable and checkable style than to read it, since you only need to type/copy-paste it during the contest anyway. Actually, reading, checking and understanding the code in the reference should be done before a contest, when you have plenty of time to refactor the code and get familiar with it. Much time is unnecessarily wasted should you have to read or question a code in the reference during a contest. ...Or if you run short on preparation time, just figure out the interface and forget about the implementation. You only need to type it or copy-paste it during the contest anyway, which, of course, does not need readability at all. I do agree it is the worst code style though, but just think about the 25-page limit of the World Final. :) |
|
На
Nisiyama_Suzune →
[Reference] Github reference project for ICPC contests/programming contests in general, 7 лет назад
0
Auto comment: topic has been updated by Nisiyama_Suzune (previous revision, new revision, compare). |
|
На
Nisiyama_Suzune →
[Reference] Github reference project for ICPC contests/programming contests in general, 7 лет назад
0
Auto comment: topic has been updated by Nisiyama_Suzune (previous revision, new revision, compare). |
|
+11
Simply substitute $$$n=gcd(i,j)$$$ in this formula. |
|
+3
Fixed. Thank you! |
|
+48
|
|
На
Magolor →
Codeforces Round #502 (in memory of Leopoldo Taravilse, Div. 1 + Div. 2) —— Editorial, 8 лет назад
+29
I think that Problem F can also be dealt with easily should one know about the technique of Extended Eratosthenes Sieve. That is, we can even solve the problem for n ≤ 1011 without the memory limit. :) My code: 41366266 By the way, Problem E can also be done by finding the minimal string rotation of two convex hulls and compare them with brute force. |
|
На
Nisiyama_Suzune →
[Reserach] The application of ML techniques on certain problems (i.e. How to make crazy hard problems that nobody can solve), 8 лет назад
+25
That is an interesting idea. Unfortunately, I have rechecked the code and it seems that the code works well on random cases. The information is updated at the end of the post. |
|
На
Nisiyama_Suzune →
[Reserach] The application of ML techniques on certain problems (i.e. How to make crazy hard problems that nobody can solve), 8 лет назад
0
Auto comment: topic has been updated by Nisiyama_Suzune (previous revision, new revision, compare). |
|
+50
I think that Div 1. E can be solved with a simple segment tree. First, just as the tutorial says, we check the possibility of "INCORRECT". Then, each of the m moments can be treated as a open-ended 3D-box, i.e. denote the moment as (xi, yi, zi), if xi < xl, the restriction for knowing the moment (x, y, z) is "CLOSED" using this knowledge will be x ≤ xi, if xl ≤ xi ≤ xr, there will be no restriction for x, and if xi > xr, the restriction will be x ≥ xi. The same goes for yi and zi. Putting the 3 restrictions together gives you a open-ended 3D-box. The query is actually asking whether each point is in any of them. This is not difficult as it seems to be. First, there are actually 8 kinds of different boxes, regarding the ≥ or ≤ sign. We can deal with them by mirroring the coordinate and do the same process 8 times, so we only need to focus on {(x, y, z)|x ≤ xi, y ≤ yi, z ≤ zi} situations. This is done by a scanning line trick. We sort both the queries and the boxes by descending x coordinate. Then each time we need to update something like {(y, z)|y ≤ yi, z ≤ zi} when we meet a box, which is simply done by a segment tree in the range of [1, ymax], maintaining the maximum value of zi on yi so that there is a box covering {(y, z)|y = yi, z ≤ zi}. My code: 40807344 |
|
0
Awww...My bad. Will fix it, sorry! |
|
0
Based on my knowledge, only crossing out even numbers first does not make a sieve O(n), so I doubt its correctness on complexity. For instance, 105 will be visited multiple times (for 3, 5 and 7) in your code. Therefore, I think your code still performs in |
|
0
You are right :) |
|
+5
It appears that I accidentally saved it as a draft. The issue should be fixed by now. Sorry for the inconvenience! |
|
+5
Thanks for the compliment:) |
|
+23
It would appear that this technique is established in 1978 by David Gries and Jayadev Misra at the communication of the ACM. They had a paper here. However, I was unable to purchase it so I cannot determine whether it is true. |
|
+10
I see. My friend has also made a hack to my own program: Many thanks! |
|
0
Would you mind sharing why most people got E WA'd by using |
|
0
Actually, you can see the test cases here for yourself. |
|
0
That's pretty unexpected. I originally thought about some edge cases, but did not ponder too much on the algorithm. Thanks a lot! |
|
+18
Actually, anyone mind sharing what E's test 24 or its general idea is? A lot people get WA'd but the case is too long to be read or copied. |
| Название |
|---|


