結果

問題 No.2195 AND Set
ユーザー mushilymushily
提出日時 2023-03-16 05:54:09
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 676 bytes
コンパイル時間 812 ms
コンパイル使用メモリ 72,896 KB
実行使用メモリ 9,396 KB
最終ジャッジ日時 2023-10-18 12:51:24
合計ジャッジ時間 7,202 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1,745 ms
4,400 KB
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 <iostream>
#include <set>

using namespace std;
int main()
{
    unsigned int q, i, t;
    long x;
    set<long> s;
    cin >> q;
    for (i = 0; i < q; i++)
    {
        cin >> t;
        switch (t)
        {
        case 1:
            cin >> x;
            s.insert(x);
            break;
        case 2:
            cin >> x;
            s.erase(x);
            break;

        default:
            if (s.size() > 0)
            {
                x = (long(1) << 31) - 1;
                for (auto itr : s)
                    x = x & itr;
            }
            else
                x = -1;
            cout << x << endl;
            break;
        }
    }
}
0