For me , it was a tough 3 hours.
I did the second one for 100 but I fear that it might time out as it was taking 6 seconds ( I use JAVA) to work for the last subtask. The complexity was O(N LOG N).
I ran out of time while debugging my first program source code so I think it will fetch me a mere 10 points :(.
It was pretty much the same for me, except that I solved the first one completely, but am not confident of my solution for the second one, and it might get a TLE for subtasks with N>4000. @animesh_f, what was your N log N solution for the second one?
Overall, I feel I could have done better, had I not wasted half an hour in debugging the first one (freakish 1-indexed arrays )
I completely messed up this one. Wasted 2.5 hours on the first problem getting nowhere, the program always giving wrong answers (I probably messed up the recursions…). Coded the second problem with this algorithm:
Make an array containing the positive divisors of n (doable in O(sqrt(n)) and sort them (O(d(n) log d(n)). Now let the number of aperiodic sequences of length m be given by f(m). Note that any periodic binary string of length n must have its minimal period dividing n, so there are a total of sum f(d), d|n, d<n periodic sequences of length n, and hence, 2^n - sum f(d), d|n, d<n aperiodic sequences of length n. We can compute this recursively (f(1)= 2) in O(d(n)^2).
This algorithm gave the correct answer for small integers (I had about 5 minutes left at this time). Then I quickly replaced the ints by long long ints, but didn’t get time to compile/debug my code finally. Just after exiting the hall, I recalled that I had made a map from int to int which stores the values of 2^n mod m for all n < 150000. Before submitting, I didn’t change this to a map from long long int to long long int, and also forgot to declare it outside int main. I guess I’m getting a 0 in this exam.
EDIT: Judging by the comment below, I still might have a chance! Thanks, neotech!
I did only the first one it worked for all the subtasks probably it will fetch me 100 pts, but moreover i am very disappointed with my performance since this was my 2nd INOI and yes We shall strike back harder next year
Did Problem 2, which in my opinion was easier. Couldn’t finish debugging Problem 1. It was getting AC for the first 2 subtasks and failing on exactly 2 of the testdata in subtasks 3 and 4. So, hopefully, with a bit of luck, I should get something in {100, 110, 120, 130}.
I did problem 1, don’t know why you guys find that difficult. That was way more easier than the second problem. The second problem was way too mathematical(atleast it was hard for me…). Anyways, what do you guys think the cutoff will be ? I’ve only solved one problem, so I’ll probably be getting 100, unless I did some silly mistake in handling corner cases etc.