Hello, CodeForces Community!
I am really pleased to announce that August Cook-Off 2017 saw mind boggling performances by the participants. The zeal and enthusiasm amongst the participants, really makes us feel proud and we are on cloud nine. To keep the competitive spirit on, we bring August LunchTime (https://www.codechef.com/LTIME51)
The contest will have four problems set by me and joining me on the problem setting panel, we have:
- Problem Setter: AlexandruValeanu (Alexandru Valeanu)
- Problem Tester and Contest Admin: kingofnumbers (Hasan Jaddouh)
- Editorialist: likecs (Bhuvnesh Jain)
- Russian Translator: CherryTree (Sergey Kulik)
- Mandarin Translator: huzecong (Hu Zecong)
- Vietnamese Translator: Team VNOI
I hope you will enjoy solving them. Please give your feedback on the problem set in the comments below after the contest.
So, note down the details and be there when the contest starts:
Time: 26th August 2017 (1930 hrs) to (2230 hrs). (Indian Standard Time — +5:30 GMT) — Check your timezone.
Details: https://www.codechef.com/LTIME51
Registration: You just need to have a CodeChef handle to participate. For all those, who are interested and do not have a CodeChef handle, are requested to register in order to participate.
Prizes: * Top 10 performers in Global and Indian category will get CodeChef laddus, with which the winners can claim cool CodeChef goodies. Know more here: https://www.codechef.com/laddu. (For those who have not yet got their previous winning, please send an email to winners@codechef.com)
Good Luck! Hope to see you participating!!
UPD: The contest has started!
UPD1: The contest has ended!
Auto comment: topic has been updated by AlexandruValeanu (previous revision, new revision, compare).
Auto comment: topic has been updated by AlexandruValeanu (previous revision, new revision, compare).
If I have totally 0 points at contest (also I submitted something), am I considered participant of contest?
Yes.
Auto comment: topic has been updated by AlexandruValeanu (previous revision, new revision, compare).
Auto comment: topic has been updated by AlexandruValeanu (previous revision, new revision, compare).
Auto comment: topic has been updated by AlexandruValeanu (previous revision, new revision, compare).
Too long queue :(
Submitted and got 10 points from MATCUT, 35 minutes passed and my score still not updated.
UPD: FIXED
I hope you all enjoyed the problems.
The editorials for the problems can be found below :
MATPAN
MATDYS
MATTEG
MATCUT
Problem 2 has a slight disadvantage for Java programmers as Java doesn't have native support for
unsigned long
, so we either have to useLong.parseUnsignedLong()
orBigInteger
. Also1 << 63
returns0
in Java , so I had to hard code the value of 263 .There is no disadvantage as Java has native support starting with version 8 (it is true that you have to use
Long.parseUnsignedLong()
but that's not a disadvantage).Please check my Java solution: https://www.codechef.com/viewsolution/15131819 (there is nothing hardcoded into it).
That's really a cool way to solve the problem . I solved it in a different way and it required me to compute 263
I guess no. The author solution in Java had nothing of that sort. You can see the source code here
Another way to solve MATDYS:
I did the same. and I still have no idea how or why it works.
Why does this brute force solution for problem 3 fails in test 1Link Please help!
Can someone explain reason for WA?
MATDYS
Array of size 5*(10^8) allowed in question Mathison and the teleportation game. Are you serious bro ??? 256 mb was more than enough
I am not sure there's a way to set the memory limit. If it is, I just don't know it.
Hey, can you provide me your solution ??
Here it is.
Sad man :( solutions without hashing and parsing passed :(
It happens! I will add a couple of tests to make sure that it is harder to get 100p in practice.
I had some issues with problem B and couldn't resolve them yet. I hope someone helps me.
(1) My initial approach :
We wish to find the element at index k after all shuffles. We view the process backwards. So we try to transform the index k to some corresponding index j before the last shuffle. Then we use this j and apply the same process again. To find the transformation from k to j, we find the window in which k lies while shuffling (by using binary search) and next do the inverse transformation to find k. Here is the link to code using the mentioned approach. Though this doesn't handle the n=64 case (I still don't know how to store it :( ) I expected my solution to clear other subtasks but it failed.
(2) Then I wrote a brute force solution to stress test my solution.Here is the link to the code. It passed the basic test cases ie with n <= 10. I just wrote a script and compared the outputs from n=1 to n=15 (I basically compared the whole array after all shuffles) and I didn't find any difference.
I don't get the mistake even now. Are the constraints for subtask 1 definitely correct?! :D
if(n==64) then in the first iteration you'll have to add 2^63(if number is odd).So just add 2^63(fits in unsigned long long) and decrement n by 1.After that you can do standard binary search.