| # | User | Rating |
|---|---|---|
| 1 | jiangly | 3810 |
| 2 | Benq | 3676 |
| 3 | Kevin114514 | 3655 |
| 4 | maroonrk | 3463 |
| 5 | strapple | 3447 |
| 6 | Um_nik | 3387 |
| 7 | heuristica | 3322 |
| 8 | turmax | 3317 |
| 9 | tourist | 3307 |
| 10 | jiangbowen | 3291 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 156 |
| 2 | nik_exists | 150 |
| 2 | maspy | 150 |
| 4 | Um_nik | 143 |
| 5 | Errichto | 139 |
| 6 | adamant | 137 |
| 7 | AmShZ | 135 |
| 8 | maroonrk | 133 |
| 9 | BledDest | 132 |
| 10 | qwexd | 129 |
|
+3
da. god good luck on your journey |
|
0
you used a 64-bit compiler, so it made sense that long long runs faster than int |
|
+30
take ratio by the number of participants then |
|
0
Would you be nice to explain your solution? thanks in advance |
|
+2
What is the solution to P6? I tried to random shuffle the input, then generate all subset sum of the first 19 elements and the last 19 elements but it failed on around 7 tests. Here is my code: Code Thanks in advance! |
|
0
in fact, |
|
+1
So we need to calculate $$$n^ {\frac{d}{2}} \bmod p$$$ where $$$d = (a_1 + 1) \times (a_2 + 1) \times \ldots \ (a_k + 1)$$$. The problem here is $$${\frac{d}{2}}$$$. If $$$d$$$ is odd, then it will be hard for us to calculate, but $$$d$$$ is odd only if all $$$a_i + 1$$$ is odd, which means all $$$a_i$$$ is even, then $$$n$$$ is a square number and ... (like my explanation above). So now, $$$d$$$ is even, and we can find some $$$a_i + 1$$$ that is even, then $$$d = (a_1 + 1) \times (a_2 + 1) \ldots \times ((a_i + 1) / 2) \ldots \times (a_k + 1)$$$. Hope that makes sense. |
|
0
In problem E you can also just simulate all their moves: My code |
|
+3
ChthollyNotaSeniorious there is some problem with markup in the solution for D |
|
+8
that hacker must be smart though, so you couldn't go and hacked other people that he would then hacked |
|
0
probably because |
|
+16
When will we be able to upsolve the problems? Thanks! |
|
0
Hints for |
|
+1
How to solve "Lampice"? Thanks! |
|
+2
for even you can also print |
|
0
|
|
On
steven.novaryo →
Codeforces Round #831 (Div. 1 + Div. 2, based on COMPFEST 14 Final), 4 years ago
0
Can you please elaborate, maybe some proof or insights? How does you get $$$dp[i] =\Sigma dp[j]$$$ in the first case and why the answer in the second case is the chain? |
|
0
A simpler solution with less math for D: We need to calculate $$$n^ {\frac{d}{2}} \bmod p$$$ where $$$d$$$ is the count of divisors of $$$n$$$ (this is actually still true even if $$$d$$$ is odd). And as we all know, if $$$n = p_1^{a_1} \times p_2^{a_2} \times \ldots \times p_k^{a_k}$$$ then $$$d = (a_1 + 1) \times (a_2 + 1) \times \ldots \ (a_k + 1)$$$. If any of $$$a_i$$$ is odd then we can divide the first $$$a_i + 1$$$ by 2 and then calculate normally. Else every $$$a_i$$$ is even, i.e. $$$n$$$ is a square number, and we can use this fact to remove the $$$/2$$$ from $$$d/2$$$. Let $$$n = x^2$$$, then $$$n^\frac{d}{2} \Leftrightarrow (x^2)^{\frac{d}{2}} \Leftrightarrow x^{2\times \frac{d}{2}} \Leftrightarrow x^d$$$. My (not so clean) implementation: 161385006. |
|
0
Actually it's possible not to precalculate, since you can find $$$C$$$ closest to $$$c$$$ can be found in $$$O(1)$$$ and $$$B$$$ closest to $$$b$$$ in $$$O(\sqrt{B})$$$ which is roughly $$$1e8$$$ operations maximum. 155903580 |
|
0
great solution :3 |
|
0
Thanks! That implementation was so elegant :orz: One small question tho, what do I know that they will help you to calculate the area of the diamond (if it is), but I don't know how does it relate to |
|
0
What is your implementation for B? I rotated the table by 45 degrees and then it can be easily solved, but it wasn't short at all. |
|
On
ak82 →
Invitation to CodeChef March Starters 29 (Rated for Div 2, 3 & 4) — 9th March, 5 years ago
0
i got the idea from that problem too :v |
|
0
you don't really need binary search tho |
|
On
Utkarsh.25dec →
Invitation to CodeChef March Starters 28 (Rated for Div 2, 3 & 4) — 2nd March, 5 years ago
+18
Lmao, I solved CNTFRAC by calculating number of solutions to $$$wz + xy = kxz$$$ (took around 500s) and then store the answer in an array. Brute force code |
|
0
yes, it's simply faster |
|
0
use Pypy 3 instead of Python 3 and it's AC 147543377 |
|
0
Currently, your code MLE at test 77 146344541, is your approach wrong or you didn't implement it neatly? |
|
0
thanks! |
|
+3
so subtracts the number of even numbers from the total number of numbers -> you get number of odd numbers |
|
0
Wow, this solution is surprisingly simple, can you explain why this would works? Thanks. |
|
+27
How to solve Break the Balance? |
|
+2
Why is the pairing in 1618D - Array and Operations optimal? It seems obvious but I can't find a proof for it. |
|
+5
change bool solve() to void solve() and it's AC |
|
-8
maybe pseudocode would be nice, and comments will only be for shortcuts and tricks |
|
-23
it would be very interesting to see the code for the $$$O(n)$$$ solution |
|
-21
C is trash. |
|
0
seems like there is some problem with the formatting Errichto |
|
0
To make your code cleaner, you can use array<ll, 4> instead of those pairs, here is the AC code with that modification 131514905 |
|
0
Sorry for necroposting but in the "Range distinct query (SPOJ DQUERY)" part, shouldn't the $$$pre[r + 1] \lt l$$$ be $$$pre[a[r + 1]] \lt l$$$ (and similarly for $$$r \lt nxt[l - 1]$$$), where $$$a$$$ is our array? box |
|
+7
thank you |
|
0
imagine fst because of this bug... |
|
+495
|
|
0
|
|
0
I just take that as an example for a slow solution that wouldn't AC. |
|
0
Can you provide the statement(or even better, links) for the COCI problems? And can you provide some examples about the DP over a digit DP part? Thanks! |
|
0
thanks for taking your time reading this blog, hope it helped you and as always jalsol orz |
|
0
Auto comment: topic has been updated by gnudgnaoh (previous revision, new revision, compare). |
|
0
Auto comment: topic has been updated by gnudgnaoh (previous revision, new revision, compare). |
|
+10
Well, at least F has a different output format. https://cses.fi/problemset/task/1133 |
|
0
Green is when the edge is oriented downwards. After you go from vert to root using the red path, now you are at the root, and from the root, you can only go downwards to other vertexes. |
|
0
"Observe that all edges outside the path from the root to vert should turn green, and those on the path should turn red." I believe this is because we will go upwards from the vert to the root (thus, all nodes must be red on the path), and from the root we will go out to other vertexes (thus, all nodes outside the path must be green). The formula can be rewritten as: |
|
+31
You should ask if the ICPC WF Invitational Division can be rescheduled to not conflict with CF rounds. |
|
0
Now this is REAL contribution. |
|
+1
The quality of problems of Codechef is incredibly high nowadays. Thank you Um_nik. |
|
0
O(N) solution for problem B div 2 (1020B - Badge) for those interested: code |
|
0
Wow, only now that I notice problem H of this contest is rated 3295 on kenkoooo.com. Idk but that seems quite high for a contest for beginners :v |
|
0
can you elaborate on the intersection part? (what is lto, lfrom, ...) |
|
0
Does anybody have problems that can be solved efficiently using this representation and is much better than other representations? |
|
+39
imagine having a supercomputer and being able to run any kind of bruteforce... |
|
0
Can you still provide code for problem F? Even though it might be incomprehensible, it might be used to stress test our solutions. Or maybe you can provide some participant's code which is more readable. |
|
-6
bad round, no pikachu theme... |
|
+6
pikachu theme? sounds interesting :)) |
|
0
Wow, it seems like 4 out of the top 5 of div 2 are alt accounts :v |
|
0
I have another solution for Chef and Closure, simply sort array a, check if |
|
0
use 2**62 or larger |
|
+16
problem F1 meme
|
|
0
Did anybody implement problem F in O(N) using prefix sums? I'm trying to implement it but can't deal with the indexes. UPD: Implemented it, code for people who need |
|
0
You can also use the Google cache :v |
|
0
Thanks. |
|
0
Does anyone have code for generating random forests so I can test my solution for D1 before the System Test ends? |
|
-7
After IOI 2020, now I feel that China team selection is harder than IOI itself :v |
|
0
Could someone explain for me the logic behind this part in the editorial code for problem G, please? that part I knew it was related to the multiplicativity of d(n) but I couldn't fully understand. And this is the whole code Thanks in advance! |
|
+39
No, you should have read the statement more carefully. |
|
+11
I wonder how many t-shirts he has had from all these global rounds and competitions... |
|
+5
May you explain why it would run much faster? |
|
0
Did anybody solve B using the randomization optimization mentioned in the hint in the editorial? |
|
0
Only 4 different characters are needed in D2: 123522856 Idea: vertical: use aa and bb abab... abab... baba... baba... then change to horizontal using cc and dd ccab... ddab... baba... baba... |
|
0
So I used the exact idea that the solution mentions, however I can't figure out (for literally hours) what is wrong with my code since everything I coded seems logical. Can anyone help me please, thanks in advance! Idea Alternatively, notice that when we add 100 to our scores, it just adds 100 to our overall score except for the case when the total number of completed stages becomes divisible by 4, when we also need to subtract the score of the worst currently included stage from the sum. We can similarly handle adding 0 to Ilya's scores. If we sort all our and Ilya's scores at the beginning and maintain a pointer to the current worst included stage in both scoresheets, we can add a new 100/0 stage and recalculate the totals in O(1). Code |
|
0
Is it possible to have the author's name and the current time (the placeholders like in the cf-tool) in the template? Right now, if I set up the template with the placeholders in the cf-tool, it won't work. |
|
0
can you explain it further ? |
|
0
btw, why is the condition for the for loop (k * (k + 1)) / 2 <= n but not (k * (k — 1)) / 2 <= n ? |
|
-20
I know this has been asked many times but please add the option to participate out of competition. |
|
-13
wow 7 problems on a div3, this is gonna be interesting :)) |
|
0
The spoiler is bugged, please fix. |
|
0
MikeMirzayanov Please add this option. This is so necessary when your schedule is just after a contest had started and you don't have any more time in you schedule to participate virtually. |
|
+4
Finally, the almost-copy-pasted-part joke is back. |
|
0
I solved A in 2 min and then struggled with B for the rest of the competition, can somebody tell me CLEARLY how to solve B ? (I know it is just implementation, but how ?) |
|
+43
Problem C is quite similar to this problem: 1438C - Engineer Artem |
|
0
Thanks, the editorial is also out and I can understand the relation now. |
|
+12
the difference between a mathematician and a programmer |
|
0
I thought of that problem but could't find the relation, can you elaborate? |
|
+1
That difficulty jump between B and C1 tho D: |
|
0
How to solve B ? |
|
On
Candidate_Master_2021 →
Will there be a time when there would be no programming contest due to lack of ideas?, 6 years ago
+9
Two problems with the same solution can be rewritten and changed the way how the contestants are going to approach it. Then, the part that is hard is getting to the point where you realize that is the same problem from before. Also, ad-hoc problems are almost impossible to run out. |
|
+32
No offense to the writers but I don't really think this contest is educational. |
|
0
A should be a better example. |
|
+6
I can't believe D is just mostly implementing what they given, I overthought that so hard D: |
|
+12
the comment section is shit |
|
0
I believe if you swap problems B and F nobody will notice and more people will have solved F. |
| Name |
|---|


