結果
| 問題 | No.3590 I Love Inversions |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-07-18 01:11:58 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 442 bytes |
| 記録 | |
| コンパイル時間 | 1,255 ms |
| コンパイル使用メモリ | 95,720 KB |
| 実行使用メモリ | 91,348 KB |
| 平均クエリ数 | 1.00 |
| 最終ジャッジ日時 | 2026-07-18 01:12:16 |
| 合計ジャッジ時間 | 18,265 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 43 |
ソースコード
from sortedcontainers import SortedSet
N = int(input())
seq = [0]
L = 1
for R in range(2,N+1):
print("?", L, R, flush = True)
x = int(input())
seq.append(x)
seq.reverse()
SS = SortedSet(range(1,N+1))
#print(seq)
#print(SS)
ans = [0] * N
for i in range(N-1):
diff = seq[i] - seq[i+1]
pos = N-(i+1)
v = SS[-(diff+1)]
ans[pos] = v
SS.remove(v)
ans[0] = SS[0]
print("!", *ans)