ログインしてください。
提出 #14556613
ソースコード 拡げる
import java.io.*;
import java.util.*;
import static java.lang.Math.min;
import static java.lang.Math.max;
public class Main {
private static void solver(InputReader sc, PrintWriter out) throws Exception {
int n = sc.nextInt();
int arr[] = new int[n]; int xor=0;
for(int i=0; i<n; i++){
arr[i] = sc.nextInt();
xor ^= arr[i];
}
for(int i=0; i<n; i++){
out.print((xor ^ arr[i])+" ");
}
}
public static void main(String[] args) throws Exception {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new InputReader(inputStream);
PrintWriter out = new PrintWriter(outputStream);
solver(in,out);
out.close();
}
static class InputReader {
public BufferedReader reader;
public StringTokenizer tokenizer;
public InputReader(InputStream stream) {
reader = new BufferedReader(new InputStreamReader(stream), 32768);
tokenizer = null;
}
public String next() {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(reader.readLine());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
public int nextInt() {
return Integer.parseInt(next());
}
public long nextLong() {
return Long.parseLong(next());
}
public double nextDouble(){
return Double.parseDouble(next());
}
}
}
class Pair implements Comparable<Pair>{
int x,y;
Pair(int x, int y){
this.x = x;
this.y = y;
}
public int compareTo(Pair p){
return (int)(this.x - p.x);
}
}
class Tuple{
String s;
int x, y;
public Tuple(String s, int x, int y) {
this.s = s;
this.x = x;
this.y = y;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Tuple tuple = (Tuple) o;
return x == tuple.x &&
y == tuple.y &&
s.equals(tuple.s);
}
@Override
public int hashCode() {
return Objects.hash(s, x, y);
}
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | E - Red Scarf |
| ユーザ | Philantropist |
| 言語 | Java (OpenJDK 11.0.6) |
| 得点 | 500 |
| コード長 | 2571 Byte |
| 結果 | AC |
| 実行時間 | 460 ms |
| メモリ | 58132 KiB |
ジャッジ結果
| セット名 | All | Sample | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 500 / 500 | 0 / 0 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| All | sample_01.txt, testcase_1.txt, testcase_10.txt, testcase_11.txt, testcase_12.txt, testcase_13.txt, testcase_14.txt, testcase_15.txt, testcase_16.txt, testcase_17.txt, testcase_18.txt, testcase_19.txt, testcase_2.txt, testcase_3.txt, testcase_4.txt, testcase_5.txt, testcase_6.txt, testcase_7.txt, testcase_8.txt, testcase_9.txt |
| Sample | sample_01.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| sample_01.txt | AC | 114 ms | 36388 KiB |
| testcase_1.txt | AC | 117 ms | 36368 KiB |
| testcase_10.txt | AC | 301 ms | 49672 KiB |
| testcase_11.txt | AC | 289 ms | 43080 KiB |
| testcase_12.txt | AC | 131 ms | 36804 KiB |
| testcase_13.txt | AC | 380 ms | 56816 KiB |
| testcase_14.txt | AC | 296 ms | 48504 KiB |
| testcase_15.txt | AC | 378 ms | 56668 KiB |
| testcase_16.txt | AC | 285 ms | 47056 KiB |
| testcase_17.txt | AC | 319 ms | 51408 KiB |
| testcase_18.txt | AC | 397 ms | 56572 KiB |
| testcase_19.txt | AC | 305 ms | 51112 KiB |
| testcase_2.txt | AC | 460 ms | 58056 KiB |
| testcase_3.txt | AC | 359 ms | 55768 KiB |
| testcase_4.txt | AC | 377 ms | 56352 KiB |
| testcase_5.txt | AC | 429 ms | 56528 KiB |
| testcase_6.txt | AC | 364 ms | 55740 KiB |
| testcase_7.txt | AC | 414 ms | 55984 KiB |
| testcase_8.txt | AC | 407 ms | 56328 KiB |
| testcase_9.txt | AC | 383 ms | 58132 KiB |