結果
問題 | No.2195 AND Set |
ユーザー |
|
提出日時 | 2022-11-28 11:00:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 783 bytes |
コンパイル時間 | 3,950 ms |
コンパイル使用メモリ | 233,188 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2024-10-06 00:40:23 |
合計ジャッジ時間 | 9,356 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | WA * 1 TLE * 1 -- * 11 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using mint = modint998244353; using ll = long long; #define all(x) x.begin(), x.end() #define rep(i, n) for (int i = 0; i < n; i++) int main(void) { int q; scanf("%d", &q); set<int> mp; int x; int ans; for(int i = 0; i < q; i++){ int t; scanf("%d", &t); if(t == 1){ scanf("%d", &x); mp.insert(x); } if(t == 2){ scanf("%d", &x); mp.erase(x); } if(t == 3){ ans = (1<<30) - 1; if (mp.size() == 0) ans &= 0; for(auto v: mp){ ans &= v; } printf("%d\n", ans); } } return 0; }