Petr's blog

By Petr, 13 years ago, In English
  • Vote: I like it
  • +36
  • Vote: I do not like it

13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
I made more mistakes this round.   >_<

ProblemA : code in Python , the only passed one.

ProblemB : s += pool[i][j]; should be s += pool[j][i];

ProblemC : 1019make the int overflow to negative numbers

ProblemD : repeated using i in the loop: 
for(int i = 1 ; i <= 500 ; i++)
		for(int i = 0 ; i < tryit.length() ; i++)

ProblemE : want to reverse the array , but write these stupid one:
		for(int i = 1 ; i <= n ; i++)
                P
[i] = P[n + 1 - i];

I just learnt a little Python, but it seems I forget how to code in C++.
4 stupid mistakes make me go back to yellow during this wonderful match.

I'm waiting for Friday's contest. 
Good luck everyone! :)
13 years ago, # |
  Vote: I like it +4 Vote: I do not like it
Yeah i was  surprised to see your today's score. I thought it might not be you!
All the best for next contest.
13 years ago, # |
  Vote: I like it +5 Vote: I do not like it
Petr, All the best for next contest.
13 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it
I failed on D.I got TL on one of big testcase.
I found solution very quickly but there was not much time remaining ,so I had to rush,my solution was a O(n^2)dp(recursive with memoization ,actually 26*n^2).I tell myself "this is O(n^2)don't even think about TL,just write a correct code",but unfortunately I have  another O(n^2) in each of recursive call so my solution timed out(26*n^4).
There was many way to avoid TL,one trivial way was using a cache,another was using KMP.
Also  if I wrote dp iteratively, probably could see 26*n^4.
P.S: This was my first system failed on CF:(
13 years ago, # |
  Vote: I like it +3 Vote: I do not like it
....I go back to yellow too....
I just want to  code the solution quickly and ignore the correctness...