結果
問題 |
No.183 たのしい排他的論理和(EASY)
|
ユーザー |
|
提出日時 | 2015-04-16 23:52:54 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 504 bytes |
コンパイル時間 | 638 ms |
コンパイル使用メモリ | 69,880 KB |
実行使用メモリ | 9,984 KB |
最終ジャッジ日時 | 2024-07-04 15:14:23 |
合計ジャッジ時間 | 11,705 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 3 TLE * 1 -- * 14 |
ソースコード
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <utility> #include <set> using namespace std; int main() { int n, in; cin >> n; set<int> a, b; a.insert(0); for (int i = 0; i < n; i++) { cin >> in; a.insert(in); } while(a.size() != b.size()) { b = a; for (auto it1 = b.begin(); it1 != b.end(); it1++) { auto it2 = it1; it2++; for (; it2 != b.end(); it2++) { a.insert(*it1 ^ *it2); } } } cout << a.size() << endl; return 0; }