結果

問題 No.2195 AND Set
ユーザー ShirotsumeShirotsume
提出日時 2022-11-28 11:00:23
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 783 bytes
コンパイル時間 3,635 ms
コンパイル使用メモリ 227,480 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-04-15 20:21:52
合計ジャッジ時間 9,111 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,624 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0