結果
問題 | No.2978 Lexicographically Smallest and Largest Subarray |
ユーザー |
![]() |
提出日時 | 2024-12-02 12:19:28 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 360 ms / 2,000 ms |
コード長 | 338 bytes |
コンパイル時間 | 525 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 90,344 KB |
平均クエリ数 | 1499.00 |
最終ジャッジ日時 | 2024-12-02 12:19:52 |
合計ジャッジ時間 | 22,980 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 57 |
ソースコード
n,q=map(int,input().split()) x=[[],[]] for i in range(500): print('?',2*i+1,n,2*i+2,n) v=input()=='1' x[v].append(2*i+2) x[v^1].append(2*i+1) a=x[0][0] b=x[1][0] for i in range(1,500): p=x[0][i] print('?',a,a,p,p) if input()=='0': a=p p=x[1][i] print('?',b,n,p,n) if input()=='1': b=p print('!',a,a,b,n)