Блог пользователя mercurist

Автор mercurist, история, 3 года назад, По-английски

Problem Link: 439C - Devu and Partitioning of the Array
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!

  • Проголосовать: нравится
  • +4
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

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