結果
問題 | No.183 たのしい排他的論理和(EASY) |
ユーザー |
![]() |
提出日時 | 2017-10-03 21:33:25 |
言語 | Java (openjdk 23) |
結果 |
MLE
|
実行時間 | - |
コード長 | 630 bytes |
コンパイル時間 | 4,223 ms |
コンパイル使用メモリ | 76,368 KB |
実行使用メモリ | 1,247,616 KB |
最終ジャッジ日時 | 2024-11-16 06:05:20 |
合計ジャッジ時間 | 97,472 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | MLE * 2 |
other | AC * 1 TLE * 3 MLE * 14 |
ソースコード
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());}}