結果
問題 |
No.2080 Simple Nim Query
|
ユーザー |
![]() |
提出日時 | 2025-07-05 01:34:42 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 710 bytes |
コンパイル時間 | 450 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 105,520 KB |
最終ジャッジ日時 | 2025-07-05 01:35:06 |
合計ジャッジ時間 | 19,802 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 TLE * 1 |
ソースコード
B=448 st1=[0]*B*B st2=[0]*B n,Q=map(int,input().split()) a=list(map(int,input().split())) for i in range(n): st1[i]=a[i] for i in range(B): st2[i]=max(st1[i*B:i*B+B]) for _ in range(Q): t,x,y=map(int,input().split()) if t==1: x-=1 st1[x]=y i=x//B st2[i]=max(st1[i*B:i*B+B]) if t==2: x-=1 y-=1 ok=0 ng=y-x+1+1 while ng-ok>1: m=(ok+ng)//2 a=0 l=y-m+1 r=y yl=l//B yr=r//B if yl==yr: a=max([a]+st1[l:r+1]) else: a=max([a]+st1[l:yl*B+B]) a=max([a]+st2[yl+1:yr]) a=max([a]+st1[yr*B:r+1]) if a==1: ok=m else: ng=m print("FS"[ok%2] if ok<y-x+1 else "SF"[ok%2])