freesoul's blog

By freesoul, history, 9 years ago, In English

Can somebdy pls help me about how to approach to this problem. http://www.spoj.com/problems/SPEC_SET/

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

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

When I solved this problem first I wrote a brute-force for small cases to check for a "pattern". If you see the "pattern" then you can come up with a greedy solution. Maybe it will be good idea to train your brute-force skills, nonetheless, here is my brute-force for checking the pattern

http://pastebin.com/qMZ4w0fp