結果
問題 | No.183 たのしい排他的論理和(EASY) |
ユーザー |
![]() |
提出日時 | 2015-07-08 22:28:14 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 242 ms / 5,000 ms |
コード長 | 356 bytes |
コンパイル時間 | 1,188 ms |
コンパイル使用メモリ | 158,404 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-29 02:16:12 |
合計ジャッジ時間 | 3,681 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int a; bool data[1<<15]; for(int i=0;i<(1<<15);i++) data[i]=false; data[0]=true; for(int i=0;i<n;i++){ cin>>a; for(int i=0;i<(1<<15);i++){ if(data[i]) data[i^a]=true; } } int ans=0; for(int i=0;i<(1<<15);i++){ if(data[i]) ans++; } cout<<ans<<endl; return 0; }