結果
問題 |
No.2080 Simple Nim Query
|
ユーザー |
|
提出日時 | 2022-09-27 02:53:30 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 686 bytes |
コンパイル時間 | 2,097 ms |
コンパイル使用メモリ | 199,420 KB |
最終ジャッジ日時 | 2025-02-07 16:50:06 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 1 WA * 7 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main () { int N, Q; cin >> N >> Q; set<int> st; st.insert(1000); for (int i = 1; i <= N; i ++) { int a; cin >> a; if (a > 1) { st.insert(-i); } } for (int q = 0;q < Q; q ++) { int t, x, y; cin >> t >> x >> y; if (t == 1) { if (y > 1) { st.insert(-x); } else if (st.find(-x) != st.end()) { st.erase(-x); } } else { int pk = -(*st.lower_bound(y)); int d = min(y - x, y - pk); cout << (d % 2 ? "S" : "F") << endl; } } }