Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

Garfield_'s blog

By Garfield_, history, 7 years ago, In English

How to solve http://codeforces.com/contest/242/problem/E problem with square root decompositatio?

Full text and comments »

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

By Garfield_, history, 7 years ago, In English

You are given a tree,number X and each node have a number on it.You have to find some nodes a1,a2,a3 ... ,an such a2 is child of a1 ,a3 is child of a2,...an is child of an - 1 and a1 + a2 + ... + an closest number to X.We say x is child of y if it's in subtree with root in y. This problem was on Serbian state competition 2014. for seniors,could you give me any hints or pseudocode?

Full text and comments »

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