Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

Vital1ty's blog

By Vital1ty, 12 years ago, In English

I came across this problem on Uva online judge from NWERC regional semilive 2010

https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2946

I have thought about a method where map<vector<pair<int,int>>,int> dp stores the best possible score Jan for the state vector<pair<int,int>>.... but i dont know how to proceed further and feel that the method is inefficient...

please help......

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
12 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

There is at most n<=1000 goodies and at most t <= 100 test cases. I think sraightforward solution will pass all test cases.