It will be fully translated later, sorry for slowpoking :(
Blackjack (problem A, div-2). The problem's author is Alex_KPR | ||
| Obviously, suits are not change the answer. Look at all possible situations: [0 - 10] — zero ways. | |
| Complexity is O(1). |
| Testing Pants for Sadness (problem B, div-2; problem A, div-1). The problem's author is Alex_KPR | |
| We can't move to the i + 1-th question before clicking all answers at i-th question. We will move to the very beginning clicking at ai - 1 answers and only one will move us to the next step. Every way from beginning to i-th question have length equal to i - 1 plus one for click. There is a simple formula for i + 1-th question: ci = (ai - 1)· i + 1, 1-based numeration. Let's summarize all values of ci for making the answer. | |
| Complexity is O(n). |
| Cthulhu (problem C, div-2; problem B, div-1). The problem's author is Alex_KPR | |
| Look at the formal part of statement. Cthulhu is a simple cycle with length of 3 or more and every vertix of the cycle should be a root of some tree. Notice this two important facts: a) Cthulhu is a connected graph If we add only one edge to tree (not a multiedge nor loop) then we will get a graph that a) and b) properties. There is a simple solution: let's check graph for connectivity (we can do it by one DFS only) and check n = m restriction. If all are ok then graph is Cthulhu. | |
Complexity is O(m). |
| Russian Roulette (problem D, div-2; problem C, div-1). The problem's author is Alex_KPR | |
| Let's solve the problem when value n is even. Obviously, if k = 1 we should put a bullet at most right position. For example, choose n = 8 and our answer string will be: .......X Let's find probability of winning at this situation. We will write zeros at losing positions and ones at winning positions: 10101010 The simple idea is to put every next bullet for non-dropping down our winning chance as long as we can. After that we should put bullets in lexicographically order with growing value of k. Look for the answer for another k's with n = 8: .....X.X When n is odd our reasoning will be the same with a little bit difference at the beginning. Look at the answer with n = 9 and k = 1:: ........X We may put second bullet as at even case. But there is exists another way, we may put our bullet at 1st position and turn left the cylinder, look here: X.......X => .......XX Obvioulsy probability of winning was not changed but answer made better. Next steps of putting are equal to even case: .....X.XX There is no difficulties to give answers to queries.
| |
Complexity is O(p). |
| Time to Raid Cowavans (problem E, div-2; problem D, div-1). The problem's author is Alex_KPR | |
| Let's solve this problem by offline. Read all queries and sort them by increasing b. After that there are many effective solutions but I tell you a most simple of them. Look at two following algorithms: 1. For each (a, b)-query calculate the answer by the simple way: for(int i = a; i < n; i += b) 2. Fix the value of b and calculate DP for all possible values of a: for(int i = n - 1; i >= 0; i--) Obvioulsy, the 1st algorithm is non-effective with little values of b and the 2nd algorithm is non-effecitve with very different values of b. Behold that it's impossible to generate the situation where all b's are so little and different simultaniously. There is a simple idea: we may solve the problem by 1st algo if values of b are so large (if they are greater than c) and solve by 2nd algo if values of b are so small (if they are less of equal to c). We need to sort our queries because of no reason to calculate DP of any b more than once. If we choose c equal to |
|
Complexity is |
| Buying Sets (problem E, div-1). The problem's author is winger | |
| Translated by Borisp. |
|

![]() Thost
|
4 months ago,
#
![]() ![]() Buying Sets is really cool.
Reply
|
![]() ABD.Luo
|
4 months ago,
#
![]() ![]() If codeforces want to face the world, why not just use the English only?
Reply
|
-
codeKNIGHT4 months ago, # ^
+2
I dont understand russian...Why dont u post it in english or atleast in both languages:(Reply -
powqer4 months ago, # ^
-2
Becouse of many people who don't know english.Reply
![]() codeKNIGHT
|
4 months ago,
#
![]() ![]() and what about the many who dont understand Russian. English is the standard language accepted all over the world.That's why I told that versions of both languages should be written.
Reply
|
-
powqer4 months ago, # ^
-1
I've answered to "why not just use the English ONLY?", not to you.Reply-
codeKNIGHT4 months ago, # ^
-1
No..Its a serious thing ,,If questions are asked in both languages then why not give solutions as well in both languagesReply
-
![]() 93willy
|
4 months ago,
#
←
Rev. 2
→
![]() ![]() Wow I really like your editorial style (grey tables, complexity at the end of task's tutorial). It would be great to: 1 - Make this style standard for every round (maybe automated: the author should only fill in a "form") 2 - Write complexity in this form: "Time: O(1) - Space: O(1)" UPD: Another idea: wouldn't be fantastic if editorial pages are structured like a wiki? With the possibility to edit (most likely to translate) the text to all users? Maybe only to "trusted" users? (something like problem tags)
Reply
|
![]() May5
|
4 months ago,
#
←
Rev. 2
→
![]() ![]() Very good job,thanks. UPD: Waiting for the full English version
Reply
|
![]() riki
|
4 months ago,
#
![]() ![]() nice tutorial. Thanks :)
Reply
|
-
ahmtbskya5 weeks ago, # ^
-2
Ohhh it's very nice,isn't it ? LOLReply
![]() Informatimukas
|
4 months ago,
#
![]() ![]() Does the last one will be translated too? :)
Reply
|
-
Alex_KPR4 months ago, # ^
0
I'll publish it when author of the problem create his own translationReply-
Borisp4 months ago, # ^
0
I did a translation of my own: http://codeforces.com/blog/entry/2539 if someone is interested. I did the translation in the way I understood winger's solution.Reply-
Alex_KPR4 months ago, # ^
0
okay, I've changed my postReply
-
-
![]() shibly
|
4 months ago,
#
![]() ![]() Nice tutorial.
Reply
|
-
ahmtbskya5 weeks ago, # ^
-3
Yeah i like it too LOLReply
![]() vidudaya
|
5 weeks ago,
#
![]() ![]() This is very much helpful. Nice work .Keep it up..
Reply
|