結果
| 問題 |
No.2978 Lexicographically Smallest and Largest Subarray
|
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2024-12-02 00:21:56 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 436 bytes |
| コンパイル時間 | 425 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 94,696 KB |
| 平均クエリ数 | 1466.18 |
| 最終ジャッジ日時 | 2024-12-02 00:22:24 |
| 合計ジャッジ時間 | 25,536 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 5 RE * 52 |
ソースコード
from functools import cmp_to_key
N,Q=map(int,input().split())
A=[i+1 for i in range(N)]
A_=[2,3,1]
def ans(a,b,c,d):
X=int(input())
return X
if A_[a-1:b] < A_[c-1:d]:
print(0)
return 0
else:
print(1)
return 1
def f(a,b):
print('?',a,N,b,N,flush=True)
X=ans(a,N,b,N)
if X==0:
return -1
else:
return 1
A.sort(key=cmp_to_key(f))
print('!',A[0],A[0],A[-1],N)
nikoro256