結果
問題 | No.183 たのしい排他的論理和(EASY) |
ユーザー |
![]() |
提出日時 | 2017-10-03 21:56:58 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 837 ms / 5,000 ms |
コード長 | 518 bytes |
コンパイル時間 | 3,779 ms |
コンパイル使用メモリ | 75,412 KB |
実行使用メモリ | 59,160 KB |
最終ジャッジ日時 | 2024-06-30 03:14:55 |
合計ジャッジ時間 | 10,872 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
import java.util.ArrayList; 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); int[] h=new int[16384*2]; h[0]=1; for(int i=0;i<n;i++){ int a=sc.nextInt(); int buf=al.size(); for(int j=0;j<buf;j++){ int newint=al.get(j)^a; if(h[newint]==0){ al.add(newint); h[newint]++; } } } System.out.println(al.size()); } }