結果

問題 No.2978 Lexicographically Smallest and Largest Subarray
ユーザー むつある
提出日時 2024-12-02 12:08:54
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 330 bytes
コンパイル時間 505 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 90,472 KB
平均クエリ数 837.46
最終ジャッジ日時 2024-12-02 12:09:15
合計ジャッジ時間 18,751 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 19 RE * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

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+1)
  x[v^1].append(2*i+2)
  
a=x[0][0]
b=x[1][0]

for i in range(1,500):
  print('?',a,a,i,i)
  if input()=='0':
    a=x[0][i]
  print('?',b,b,i,b)
  if input()=='1':
    b=x[1][i]
    
print('!',a,a,b,n)
0