About two months ago we ran another regional intercollegiate team contest. The corresponding gym contest on Codeforces will be held on Sunday, June 7, 2015, at 13:00 UTC +3:00.
Contest was prepared by Sinner, dalex, Slamur. Also special thanks to craus, Shlakoblock and I_love_natalia.
Contest will be available on this page: Codeforces Gyms
The list of our previous contests:
- 2012, Samara SAU ACM ICPC Quarterfinal Qualification Contest
- 2013, VI Samara Regional Intercollegiate Programming Contest
- 2013, Samara SAU ACM ICPC Quarterfinal Qualification Contest
- 2014, VII Samara Regional Intercollegiate Programming Contest
- 2014, Samara SAU ACM ICPC Quarterfinal Qualification Contest
I have some question(I am new in CF & it is my first GYM contest):
Sorry for my poor English. Thanks in advance.
It will be gym contest, so:
Reminder: the contest starts soon, the registration is opened.
It's 20 minutes before start. We begin at 13.00 MSK.
Final reminder, 5 minutes before start (13.00 MSK)
What is the idea for L ?
K + 1 rings can be moved in 2K + 1 turns:
So you can use next algo to move N rings:
F(N) = F(N — K — 1) + (2K + 1) + F(N — K — 1)
F(N) = 2F(N — K — 1) + (2K + 1)
If you enumerate groups of (K + 1) rings, this fotmula will be:
G(i) = 2G(i-1) + (2K + 1)
G(0) = if (M = N mod (K + 1)) == 0 then 0 else (2(M — 1) + 1)
It can be solved with matrix exponentation or even with deriving of formula.
I was asked to write quick one-line hints for all problems. They are in the first revision.
There are also some typos but it's difficult to edit and make another spoiler, so I'll leave it as is.
Anotyer way to solve B in the first revision.
Can you provide the explanation for M? I dint get what dalex wants to say here.
Thanks.
Detailed M (see 1st revision)
Where can I find the 1st revision you are talking about, please ?
Above a comment, there is an option saying <-- Rev x.(x is some positive integer)
Pressing that gets you to previous versions of the comment.
Any hint on question K please??
Hints are in the comment above by dalex. Just go back to revision 1 of the comment to see the hint.
Can someone who has solved problem A post the 13th test-case here. I am getting WA and I can't figure out my mistake. Thanks. This is my code http://ideone.com/hPM1Ud Problem A
Problem C can also be found in Algorithm Design by Kleinberg and Tardos (here)