Search found 5 matches

by Hao Hu
Thu Jan 25, 2007 11:30 am
Forum: Volume 2 (200-299)
Topic: 210 - Concurrency Simulator
Replies: 16
Views: 4657

210 - Concurrency Simulator

Hi, I tried this problem today but got WA. I thought I implemented the rules of concurrency simulation described well, and I've already searched this forum for help / tricky parts as well as test datas generated by others. But I still can't find my problem is. I think it works well. So would you ple...
by Hao Hu
Mon Jan 01, 2007 2:53 pm
Forum: Volume 111 (11100-11199)
Topic: 11149 - Power of Matrix
Replies: 42
Views: 19872

i didn't find anything wrong in the base case of solve(k) Matrix solve(int k) { if(k==1) return m; Matrix ret=solve(k/2); Matrix pow=power(m,k/2); Matrix tmp=add(ret,mul(pow,ret)); if(k%2==1) { Matrix tt=mul(pow,pow); Matrix newpow=mul(tt,m); Matrix ans=add(tmp,newpow); return ans; } return tmp; } ...
by Hao Hu
Mon Jan 01, 2007 10:55 am
Forum: Volume 111 (11100-11199)
Topic: 11153 - Museums
Replies: 16
Views: 9216

Can you give me some further hint on this problem? I first thought to use the dynamic programming method that is similar to that in the Hamilton Path which runs in O(2^n*n^2) time but then found one can past a node several times... my searching + optimization got TLE.... wondering what is the correc...
by Hao Hu
Mon Jan 01, 2007 8:57 am
Forum: Volume 111 (11100-11199)
Topic: 11149 - Power of Matrix
Replies: 42
Views: 19872

Problem solved...so careless in the base case of solve(k).
by Hao Hu
Mon Jan 01, 2007 8:30 am
Forum: Volume 111 (11100-11199)
Topic: 11149 - Power of Matrix
Replies: 42
Views: 19872

11149 Power of Matrix WA

code removed because of getting accepted

Go to advanced search