dreamoon_love_AA's blog

By dreamoon_love_AA, 12 years ago, In English
I think so because the rank 1 of unofficials code seem to be wrong(if I don't misunderstand the meaning of problem).

we can test the following data:

7 8
1 2 M
1 4 M
3 4 M
7 6 M
2 4 S
1 3 S
3 5 S
4 6 S

the output of his code is -1.
but I think
6
1 2 4 6 7 8
is one of possible solution.
  • Vote: I like it
  • +47
  • Vote: I do not like it

»
12 years ago, # |
  Vote: I like it +10 Vote: I do not like it
Sad, but true =(
»
12 years ago, # |
  Vote: I like it 0 Vote: I do not like it
good, how did you do it?
»
12 years ago, # |
Rev. 2   Vote: I like it +15 Vote: I do not like it

I think this input should somehow be tested with the official solution, to check if it's only a missing test case among the ones used during the contest or if the solution itself is wrong (maybe some test case actually used covers this case?). When this is the case, they usually make the contest unrated...

ED: Nevermind, there're others accepted codes that handle this case correctly. It's just a missing test case. That first code, however, is still wrong.