結果
| 問題 |
No.2195 AND Set
|
| コンテスト | |
| ユーザー |
mushily
|
| 提出日時 | 2023-03-16 05:54:09 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 676 bytes |
| コンパイル時間 | 1,381 ms |
| コンパイル使用メモリ | 72,528 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-09-18 09:11:46 |
| 合計ジャッジ時間 | 8,315 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 1 TLE * 1 -- * 11 |
ソースコード
#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;
}
}
}
mushily