Codeforces и Polygon могут быть недоступны в период с 23 мая, 7:00 (МСК) по 23 мая, 11:00 (МСК) в связи с проведением технических работ. ×

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

Автор john9, 11 лет назад, По-английски

how do we know in problem 317B - Муравьи an array of a[147][147] will suffice?? thanks in advance

Полный текст и комментарии »

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

Автор john9, 11 лет назад, По-английски

i solved problem c of Croc Champ 2013 — Round 2 (Div. 2 Edition) but in my solution forgot to remove the system("pause"). Here is it 3607081 and was no able to correct it during the competition because of lack of time (i submitted just before the end) after competition here is the same code( without the Damn system("pause") ) 3607703 that got accepted. Hope i will learn from my mistakes!!!!

Полный текст и комментарии »

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

Автор john9, 11 лет назад, По-английски

A tree can be split into two different trees by removing one of its edges. Given a tree with N nodes uniquely identified by integer numbers in the [0, N-1] range

Your task is to

write a function that finds the edge that needs to be removed from the tree, such that the difference between the sums of all the node IDs in the resulting trees is minimum

your function will print the minimum difference that you found to the standard output (stdout)

Note that your function will receive the following arguments:

parent which is an array of integer numbers with the following meaning: parent[i] = the parent of node i (more specifically its ID)

parent[i] = -1 if i has no parent (i is the root of the tree)

Data constraints

the maximum number of nodes in the tree is 50,000

Efficiency constraints

your function is expected to print the result in less than 2 seconds

Example

Input parent: 1, 4, 4, 2, -1, 2, 2

Output 9

Explanation We remove the edge between nodes 2 and 6.

Полный текст и комментарии »

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

Автор john9, 11 лет назад, По-английски

Given two points what is the best possible way to generate two more points such that they form square

Полный текст и комментарии »

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

Автор john9, 11 лет назад, По-английски

My Solution to 253C - Text Editor is producing TLE? here is the link to solution 2797003

Полный текст и комментарии »

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

Автор john9, 12 лет назад, По-английски

this is the problem :- 224B - Array this is the submission :- 2192415

Полный текст и комментарии »

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

Автор john9, 12 лет назад, По-английски

126B - Password i have seen a few solutions but am not clear as to how the dp is working anybody please provide some explanation on how to solve this problem

Полный текст и комментарии »

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

Автор john9, 12 лет назад, По-английски
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится