結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー tsunabittsunabit
提出日時 2020-03-11 16:29:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 548 ms / 5,000 ms
コード長 474 bytes
コンパイル時間 4,883 ms
コンパイル使用メモリ 71,908 KB
実行使用メモリ 61,968 KB
最終ジャッジ日時 2023-09-15 22:43:45
合計ジャッジ時間 12,236 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
55,924 KB
testcase_01 AC 134 ms
55,868 KB
testcase_02 AC 136 ms
56,080 KB
testcase_03 AC 137 ms
57,824 KB
testcase_04 AC 136 ms
55,856 KB
testcase_05 AC 139 ms
55,488 KB
testcase_06 AC 136 ms
55,956 KB
testcase_07 AC 526 ms
60,152 KB
testcase_08 AC 497 ms
60,604 KB
testcase_09 AC 402 ms
61,968 KB
testcase_10 AC 440 ms
60,288 KB
testcase_11 AC 492 ms
60,568 KB
testcase_12 AC 138 ms
55,860 KB
testcase_13 AC 129 ms
55,968 KB
testcase_14 AC 455 ms
57,236 KB
testcase_15 AC 548 ms
61,232 KB
testcase_16 AC 134 ms
55,712 KB
testcase_17 AC 260 ms
58,352 KB
testcase_18 AC 518 ms
60,340 KB
testcase_19 AC 246 ms
56,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class No183 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = (int)Math.pow(2, 15);
		boolean[] b = new boolean[m];
		b[0] = true;
		for(int i = 0; i < n; i++) {
			int t = sc.nextInt();
			for(int j = 0; j < m; j++) {
				if(b[j]) b[j^t] = true;
			}
		}
		int c = 0;
		for(int i = 0; i < m; i++) if(b[i]) c++;
		System.out.println(c);
	}
}
0