Codeforces and Polygon may be unavailable from May 23, 4:00 (UTC) to May 23, 7:00 (UTC) due to technical maintenance. ×

daiict218's blog

By daiict218, history, 6 years ago, In English

Hi,

In the above problem, I tried using the method of diving an array in two subsets with minimum difference but it gave me wrong answer for the test case

5
110 90 70 50 40

For me, the answer should be that one person would take pizza with sector angles 90,40 and 50 and other person will take sectors 110 and 70. Did I understand the problem incorrectly?

  • Vote: I like it
  • -5
  • Vote: I do not like it

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

Hi, you understood the problem incorrectly. You don't have to divide into subsets. You have to divide it into contiguous subarrays.

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

And how about this test case?

4
170 30 150 10

The answer is 0 for this and described in problem statement.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    The answer is 0 because is a pizza, the array is like a circle.

    170] [30 150] [10

    So the two groups sum 180

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

Anyway, it was the worst formatting of language. The problem statement should be more clear because not all the people know English that well.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +7 Vote: I do not like it

    The problem statement says: "Vasya and Petya want to divide all pieces of pizza into two continuous sectors in such way that the difference between angles of these sectors is minimal." The keyword "continuous" is actually written in italic letters to point this out.