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

Автор virus_1010, история, 7 лет назад, По-английски

Hello everyone,

I recently gave this gym contest (virtual) and couldn't come up with a solution to problem G.

The problem is as follows: Given a graph with n ( ≤  103) nodes and some edges (  ≤  n *(n - 1)  /  2). Let's denote m as the maximum degree in the graph. Now you need to color the graph with 2 colors with the constraint that each node can have atmost m / 2 neighbors with the same color as the node itself . Given the above info, give the coloring of the graph.

Please help me solve it.

Thanks.

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

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

Автор virus_1010, история, 7 лет назад, По-английски

I did the problem COT2(http://www.spoj.com/problems/COT2/) using Mo's Algorithm on trees....Wondering if a solution faster than n*sqrt(n) exists?

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

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

Автор virus_1010, история, 7 лет назад, По-английски

Given T(1 <= T <= 1e5) the no. of test cases.
Each testcase contains an integer N(1 <= N <= 1e18).
We define F(x) as the xor of all the digits in x.
Find (summation of F(x) where x goes from 1 to N) for each testcase.
Can anyone help me with this?

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

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