Solved string reduction. Now have 7.
Claire gave a very simple solution which also has a simple proof of correctness. Keep working on char with max cnt and another neighboring char until no more operation is possible. You must be left with 1 or 2 equal char. My solution is much more complicated and I do not have a good proof so far.
Your rank: 71
Your score: 460.625
Jan 6 update: hacked the bipartite matching code a bit and had 2 more testcases passed for problem solving problem.
Your rank: 66
Your score: 479.625
Jan 7 update: one more problem AC, string transmission. enumerate all periods and some simple DP with memorization.
Your rank: 63
Your score: 513.5
It gets harder to move up in rank now.
Jan 08 update
Had 2/10 for circle summation. Why TLE.
After 3 TLE, lost all 6pt earned for this problem. Back to 63.
solved circle summation, need O(N^2 logM) where N=50, M=10^9
Your rank: 61
Your score: 526
Rank Hacker Country Score Submissions Solved
61 lantimilan NA 526.00 36 9
Solved Equations, the answer is derived by x*y/(x+y)=N! and then ans is the number of factors of N!^2.
EQUATIONS C++
Submission Accepted
15/15 testcases passed
45 Point(s)
View Submission Processed 2012-01-09 01:22 UTC
Lego blocks: A simple DP problem, I don't know why I didn't solve it earlier.
Lego Blocks C++
Submission Accepted
10/10 testcases passed
50 Point(s)
View Submission Processed 2012-01-09 05:42 UTC
Now has 11. The remaining problems would be tough.
Subscribe to:
Post Comments (Atom)
Would you help give some hints on Lego blocks?
ReplyDeleteI don't know how to represent the state of this DP problem.
Many thanks.
draw some picture and you can probably see a pattern. topcoder has a similar or same problem before, although I didn't recall where it is. My idea is to split at some vertical line so the two parts left and right can be solved separately.
ReplyDeletehi
ReplyDeletehow do u calculate n!^2 when n is very large say 10000
I do not know any way to calculate n! faster than O(n).
ReplyDeleteHey ! One of the test case for billboards problem us giving TLE. I am using O(NK) time complexity. Any suggestion ?
ReplyDeleteAbout Lego Blocks: My DP solution has 9/10 accepted. I am at a loss as to why 1 test case failed. these type of failures turn out to be very are hard to fix. Could you please share what precautions had you taken for boundary cases ? Any tricky boundary cases ?
ReplyDeleteNever mind, I figured that out. I have an AC now.
ReplyDeleteI take the same idea to deal with the Equations 1/x+1/y=1/N! problem,but I found my program can't pass the test01.I wonder where is wrong ....so frustrated.
ReplyDeleteI tried to solve the "Problem solving" using greedy: delete the longest path every time. However the result is wrong, could you give me some suggestion? Thanks
ReplyDelete2
ReplyDelete4 6
4 5
plzz tell output of above testcase
some help with the DP of string transmission?
ReplyDelete