結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー hhgfhn1hhgfhn1
提出日時 2018-10-30 12:45:00
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 540 bytes
コンパイル時間 2,313 ms
コンパイル使用メモリ 75,060 KB
実行使用メモリ 53,604 KB
最終ジャッジ日時 2024-04-30 00:35:22
合計ジャッジ時間 10,313 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
41,220 KB
testcase_01 AC 135 ms
41,236 KB
testcase_02 AC 164 ms
41,552 KB
testcase_03 AC 138 ms
41,300 KB
testcase_04 AC 138 ms
41,164 KB
testcase_05 AC 170 ms
42,068 KB
testcase_06 AC 134 ms
41,152 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int n=scanner.nextInt();
		Set<Integer>set=new HashSet<>();
		int a[]=new int[n];
		for(int i=0;i<n;i++) {
			a[i]=scanner.nextInt();
		}
		for(int i=0;i<Math.pow(2, n);i++) {
			int tmp=0;
			for(int j=0;j<n;j++) {
				if((i>>j&1)==1) {
					tmp^=a[j];
				}
			}
			set.add(tmp);
		}
		System.out.println(set.size());
	}
}
0