結果
| 問題 | No.2978 Lexicographically Smallest and Largest Subarray |
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2024-12-02 00:21:56 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 436 bytes |
| 記録 | |
| コンパイル時間 | 303 ms |
| コンパイル使用メモリ | 85,376 KB |
| 実行使用メモリ | 103,020 KB |
| 平均クエリ数 | 1466.18 |
| 最終ジャッジ日時 | 2026-05-24 14:48:32 |
| 合計ジャッジ時間 | 14,624 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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