Pls help me to find Task and Solutions for Russian olympiad of informatic 2009 !!!
Pls help me to find Task and Solutions for Russian olympiad of informatic 2009 !!!
The sequence of non-negative integers A1, A2, ..., AN is given. You are to find some subsequence Ai1, Ai2, ..., Aik (1 <= i1 < i2 < ... < ik <= N) such, that Ai1 XOR Ai2 XOR ... XOR Aik has a maximum value.
Input The first line of the input file contains the integer number N (1 <= N <= 100). The second line contains the sequence A1, A2, ..., AN (0 <= Ai <= 10^18).
Output Write to the output file a single integer number -- the maximum possible value of Ai1 XOR Ai2 XOR ... XOR Aik.
Given a non directed graph G = (V,E) and K query, N vertices and M arcs. (N,M,K <= 100000) for i-th query, I have 2 number (u[i],v[i]), it mean, if arcs(u[i],v[i]) don't exist, I will add them. if arcs(u[i],v[i]) exist, I will delete them. In M arcs, I have N-1 arcs can't be delete, it's spanning tree. So for each i-th query, I must find the number of bridges on this graph. Pls give me some idea for this problems. thank!!!
P/s : sorry for my bad english