virus_1010's blog

By virus_1010, history, 17 months ago, In English,

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.

Read more »

 
 
 
 
  • Vote: I like it  
  • +12
  • Vote: I do not like it  

By virus_1010, history, 2 years ago, In English,

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?

Read more »

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

By virus_1010, history, 2 years ago, In English,

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?

Read more »

 
 
 
 
  • Vote: I like it  
  • +7
  • Vote: I do not like it