結果
問題 | No.2080 Simple Nim Query |
ユーザー | CleyL |
提出日時 | 2022-09-27 23:26:02 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 628 bytes |
コンパイル時間 | 674 ms |
コンパイル使用メモリ | 78,844 KB |
実行使用メモリ | 12,692 KB |
最終ジャッジ日時 | 2023-08-24 04:12:10 |
合計ジャッジ時間 | 4,864 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,380 KB |
testcase_01 | AC | 2 ms
4,376 KB |
testcase_02 | AC | 1 ms
4,376 KB |
testcase_03 | WA | - |
testcase_04 | AC | 302 ms
4,376 KB |
testcase_05 | AC | 622 ms
12,692 KB |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | AC | 544 ms
11,024 KB |
ソースコード
#include <iostream> #include <set> using namespace std; int main(){ int n,q;cin>>n>>q; set<int> A; for(int i = 0; n > i; i++){ int x;cin>>x; if(x != 1)A.insert(i); } for(int i = 0; q > i; i++){ int t,x,y;cin>>t>>x>>y; if(t==1){ if(y == 1)A.erase(--x); else A.insert(--x); }else{ if(A.size()){ auto z = --A.lower_bound(y); if((y-*z)%2){ cout << "F" << endl; }else{ cout << "S" << endl; } }else{ if((y-x)%2){ cout << "F" << endl; }else{ cout << "S" << endl; } } } } }