結果
問題 |
No.183 たのしい排他的論理和(EASY)
|
ユーザー |
![]() |
提出日時 | 2015-07-27 00:56:52 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 711 bytes |
コンパイル時間 | 866 ms |
コンパイル使用メモリ | 70,272 KB |
実行使用メモリ | 12,804 KB |
最終ジャッジ日時 | 2024-07-16 00:22:29 |
合計ジャッジ時間 | 7,130 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 5 TLE * 1 -- * 12 |
ソースコード
//Name: //Level: //Category: //Note: /** * */ #include <iostream> #include <unordered_set> using namespace std; bool solve(bool first) { int N; if(!(cin >> N)) return false; unordered_set<int> res, buf; res.insert(0); for(int i = 0; i < N; ++i) { int a; cin >> a; buf.clear(); for(const int n : res) { buf.insert(a ^ n); } res.insert(buf.begin(), buf.end()); } cout << res.size() << endl; return true; } int main() { cin.tie(0); ios::sync_with_stdio(0); cout.setf(ios::fixed); cout.precision(10); bool first = true; while(solve(first)) { first = false; } return 0; }