結果

問題 No.2080 Simple Nim Query
ユーザー CleyLCleyL
提出日時 2022-09-27 23:56:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 410 bytes
コンパイル時間 2,079 ms
コンパイル使用メモリ 205,852 KB
実行使用メモリ 12,628 KB
最終ジャッジ日時 2023-08-24 04:12:55
合計ジャッジ時間 6,081 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int n,q,t,x,y;
int main(){
  cin>>n>>q;
  set<int> A;
  A.insert(-1);
  for(;n>y;y++){
    cin>>x;
    if(--x)A.insert(y);
  }
  while(q--){
    cin>>t>>x>>y;
    if(--t){
      auto z=--A.lower_bound(y);
      if(*z>x-2)cout << "SF"[(y-*z)%2] << endl;
      else cout << "FS"[(y-x)%2] << endl;
    }else{
      A.insert(--x);
      if(--y)A.erase(x);
    }
  }
}
0