結果
| 問題 |
No.2978 Lexicographically Smallest and Largest Subarray
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-12-02 14:50:53 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 395 bytes |
| コンパイル時間 | 458 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 90,592 KB |
| 平均クエリ数 | 1501.00 |
| 最終ジャッジ日時 | 2024-12-02 14:51:18 |
| 合計ジャッジ時間 | 24,735 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 57 |
ソースコード
N,Q=map(int,input().split())
small=[]
large=[]
for i in range(0,N,2):
print("?",i+1,N,i+2,N)
res=input()
if res=="1":
large.append(i+1)
small.append(i+2)
else:
large.append(i+2)
small.append(i+1)
sm=small[0]
for i in small:
print("?",sm,N,i,N)
res=input()
if res=="1":
sm=i
la=large[0]
for i in large:
print("?",la,N,i,N)
res=input()
if res=="0":
la=i
print("!",sm,sm,la,N)