結果
問題 | No.183 たのしい排他的論理和(EASY) |
ユーザー | fjafjafja |
提出日時 | 2017-10-03 21:33:25 |
言語 | Java21 (openjdk 21) |
結果 |
MLE
|
実行時間 | - |
コード長 | 630 bytes |
コンパイル時間 | 3,073 ms |
コンパイル使用メモリ | 75,664 KB |
実行使用メモリ | 728,540 KB |
最終ジャッジ日時 | 2024-04-27 22:54:00 |
合計ジャッジ時間 | 10,445 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 105 ms
40,768 KB |
testcase_01 | AC | 105 ms
41,148 KB |
testcase_02 | MLE | - |
testcase_03 | -- | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
ソースコード
import java.util.ArrayList; import java.util.HashSet; import java.util.Scanner; public class N183 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n=sc.nextInt(); ArrayList<Integer> al=new ArrayList<Integer>(); al.add(0); for(int i=0;i<n;i++){ int buf=al.size(); int a=sc.nextInt(); for(int j=0;j<buf;j++){ int newint=al.get(j)^a; for(int k=0;k<buf;k++){ if(newint==al.get(k)){ break; } al.add(newint); } } } HashSet<Integer> hs=new HashSet<Integer>(); for(Integer all:al){ hs.add(all); } System.out.println(hs.size()); } }