F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

CS Course

Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 5238    Accepted Submission(s): 1879


Problem Description
Little A has come to college and majored in Computer and Science.

Today he has learned bit-operations in Algorithm Lessons, and he got a problem as homework.

Here is the problem:

You are giving n non-negative integers $a_1,a_2,\cdots ,a_n$, and some queries.

A query only contains a positive integer p, which means you
are asked to answer the result of bit-operations (and, or, xor) of all the integers except $a_p$.
 

Input
There are no more than 15 test cases.

Each test case begins with two positive integers n and p
in a line, indicate the number of positive integers and the number of queries.

$2 \leq n,q \leq 10^5$

Then n non-negative integers $a_1,a_2,\cdots,a_n$ follows in a line, $0 \leq a_i \leq 10^9$ for each i in range[1,n].

After that there are q positive integers $p_1,p_2,\cdots,p_q$in q lines, $1 \leq p_i \leq n$ for each i in range[1,q].
 

Output
For each query p, output three non-negative integers indicates the result of bit-operations(and, or, xor) of all non-negative integers except $a_p$ in a line.
 

Sample Input
3 3 1 1 1 1 2 3
 

Sample Output
1 1 0 1 1 0 1 1 0
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-20 05:41:52, Gzip enabled