mercurist's blog

By mercurist, history, 3 years ago, In English

Problem Link: 439C - Деву и разбиение массива
My Latest Submission: 110975767

Verdict: WA on tc#60
image

My approach: Create first (k - p) parts using a single odd element in each of them. For the next p parts, treat the first (p - 1) parts separately using odd elements in pairs first, and if we run out of odd elements, use a single even element afterwards. For the last part, display everything that's left.

PS: I know CF blogs aren't the best place for query resolution but it's the only one I've got!

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

»
3 years ago, # |
  Vote: I like it +3 Vote: I do not like it

test case: 3 2 0 1 2 3 your output: 1 1 1 3 1 2 (you have 3 parts instead of 2)