結果

問題 No.2496 LCM between Permutations
ユーザー mkawa2mkawa2
提出日時 2023-10-06 22:42:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 362 bytes
コンパイル時間 119 ms
コンパイル使用メモリ 10,992 KB
実行使用メモリ 25,352 KB
平均クエリ数 656.00
最終ジャッジ日時 2023-10-06 22:42:34
合計ジャッジ時間 6,274 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
24,744 KB
testcase_01 AC 42 ms
24,952 KB
testcase_02 AC 43 ms
24,864 KB
testcase_03 RE -
testcase_04 AC 43 ms
24,568 KB
testcase_05 AC 44 ms
24,488 KB
testcase_06 AC 44 ms
24,736 KB
testcase_07 RE -
testcase_08 AC 44 ms
24,548 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 43 ms
24,864 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 55 ms
24,684 KB
testcase_18 RE -
testcase_19 AC 111 ms
24,548 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 AC 105 ms
25,000 KB
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import lru_cache

@lru_cache(None)
def ask(i, j):
    print("?", i+1, j+1, flush=True)
    return int(input())

n = int(input())
mn, i1 = 10**9, -1
for i in range(n):
    x = ask(i, 0)
    if x < mn: mn, i1 = x, i

bb=[0]*n
for j in range(n):bb[j]=ask(i1,j)
j1=bb.index(1)
aa=[0]*n
for i in range(n):aa[i]=ask(i,j1)

print("!",*aa,*bb,flush=True)
0