### virus_1010's blog

By virus_1010, history, 6 years ago, 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.

Thanks.

By virus_1010, history, 7 years ago, 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?

By virus_1010, history, 7 years ago, 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?