sal2's blog

By sal2, history, 5 years ago, In English

Hello everyone,

Can anyone tell me why the answer of this problem:
1283E - New Year Parties

to this test case:
9
9 5 7 9 6 4 6 4 8

is:
2 8

isn't 3 8 ?

Thanks in advanced.

  • Vote: I like it
  • +12
  • Vote: I do not like it

| Write comment?
»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

If we sort the array then it is like 4 4 5 6 6 7 8 9 9 We can convert it like 5 5 5 5 5 8 8 8 8 So the minimum answer is 2 instead of 3

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

Hello, I can't ac this problem . Can you show me your code? Java