結果

問題 No.2577 Simple Permutation Guess
ユーザー mkawa2mkawa2
提出日時 2023-12-06 16:22:02
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 1,371 bytes
コンパイル時間 385 ms
コンパイル使用メモリ 81,828 KB
実行使用メモリ 653,348 KB
平均クエリ数 0.07
最終ジャッジ日時 2023-12-06 16:24:02
合計ジャッジ時間 6,151 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
69,596 KB
testcase_01 MLE -
testcase_02 MLE -
testcase_03 MLE -
testcase_04 MLE -
testcase_05 MLE -
testcase_06 MLE -
testcase_07 MLE -
testcase_08 MLE -
testcase_09 MLE -
testcase_10 MLE -
testcase_11 MLE -
testcase_12 AC 64 ms
75,100 KB
testcase_13 MLE -
testcase_14 MLE -
testcase_15 MLE -
testcase_16 AC 61 ms
69,596 KB
testcase_17 AC 61 ms
69,596 KB
testcase_18 AC 62 ms
69,596 KB
testcase_19 AC 61 ms
69,596 KB
testcase_20 AC 60 ms
69,596 KB
testcase_21 AC 60 ms
69,596 KB
testcase_22 AC 60 ms
69,588 KB
testcase_23 AC 61 ms
69,588 KB
testcase_24 AC 61 ms
69,588 KB
testcase_25 AC 61 ms
69,588 KB
testcase_26 AC 61 ms
69,588 KB
testcase_27 AC 61 ms
69,588 KB
testcase_28 AC 60 ms
69,588 KB
testcase_29 AC 60 ms
69,588 KB
testcase_30 AC 62 ms
69,588 KB
testcase_31 AC 61 ms
69,596 KB
testcase_32 AC 81 ms
69,596 KB
testcase_33 AC 61 ms
69,596 KB
testcase_34 AC 61 ms
69,596 KB
testcase_35 AC 63 ms
69,596 KB
testcase_36 AC 61 ms
69,596 KB
testcase_37 AC 61 ms
69,588 KB
testcase_38 AC 60 ms
69,588 KB
testcase_39 AC 60 ms
69,588 KB
testcase_40 AC 60 ms
69,588 KB
testcase_41 AC 60 ms
69,588 KB
testcase_42 AC 60 ms
69,588 KB
testcase_43 AC 61 ms
69,588 KB
testcase_44 AC 61 ms
69,588 KB
testcase_45 AC 60 ms
69,588 KB
testcase_46 AC 60 ms
69,588 KB
testcase_47 AC 60 ms
69,588 KB
testcase_48 AC 59 ms
69,588 KB
testcase_49 AC 60 ms
69,588 KB
testcase_50 AC 60 ms
69,588 KB
testcase_51 AC 60 ms
69,588 KB
testcase_52 AC 59 ms
69,588 KB
testcase_53 AC 59 ms
69,588 KB
testcase_54 AC 59 ms
69,588 KB
testcase_55 AC 61 ms
69,588 KB
testcase_56 AC 60 ms
69,588 KB
testcase_57 AC 60 ms
69,588 KB
testcase_58 AC 60 ms
69,588 KB
testcase_59 AC 60 ms
69,588 KB
testcase_60 AC 60 ms
69,588 KB
testcase_61 AC 59 ms
69,588 KB
testcase_62 AC 61 ms
69,588 KB
testcase_63 AC 61 ms
69,588 KB
testcase_64 AC 61 ms
69,588 KB
testcase_65 AC 62 ms
69,588 KB
testcase_66 AC 61 ms
69,588 KB
testcase_67 AC 61 ms
69,588 KB
testcase_68 AC 60 ms
69,588 KB
testcase_69 AC 60 ms
69,588 KB
testcase_70 AC 60 ms
69,588 KB
testcase_71 AC 60 ms
69,588 KB
testcase_72 AC 59 ms
69,588 KB
testcase_73 AC 60 ms
69,596 KB
testcase_74 MLE -
testcase_75 MLE -
testcase_76 MLE -
testcase_77 MLE -
testcase_78 MLE -
testcase_79 MLE -
testcase_80 MLE -
testcase_81 MLE -
testcase_82 MLE -
testcase_83 MLE -
testcase_84 MLE -
testcase_85 MLE -
testcase_86 MLE -
testcase_87 MLE -
testcase_88 MLE -
testcase_89 MLE -
testcase_90 MLE -
testcase_91 MLE -
testcase_92 MLE -
testcase_93 MLE -
testcase_94 MLE -
testcase_95 MLE -
testcase_96 MLE -
testcase_97 MLE -
testcase_98 MLE -
testcase_99 MLE -
testcase_100 MLE -
testcase_101 MLE -
evil_1_rnd_1.txt MLE -
evil_1_rnd_2.txt MLE -
evil_2_big_1.txt MLE -
evil_2_big_2.txt MLE -
evil_2_big_3.txt MLE -
evil_3_sorted_1.txt MLE -
evil_4_sorted_rev_1.txt MLE -
evil_4_sorted_rev_2.txt MLE -
evil_400_sorted.txt MLE -
evil_400_sorted_rev.txt MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(1000005)
# sys.set_int_max_str_digits(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()

dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
# inf = -1-(-1 << 31)
inf = -1-(-1 << 63)
md = 10**9+7
# md = 998244353

from itertools import permutations

# memo={}
def ask(q):
    # if q in memo:return memo
    print("?", *q, flush=True)
    res=II()
    # memo[q]=res
    return res

n=II()
a=list(range(1,n+1))

pre=[]
while len(a)>10:
    l,r=0,len(a)
    while l+1<r:
        m=(l+r)//2
        q=pre+[a[m]]+a[:m]+a[m+1:]
        if ask(tuple(q)):
            l=m
        else:
            r=m
    pre.append(a.pop(l))
    # print(ans,a)

pp=list(permutations(a))

l,r=0,len(pp)
while l+1<r:
    m=(l+r)//2
    if ask(pre+list(pp[m])):
        l=m
    else:
        r=m

ans=pre+list(pp[l])
print("!",*ans,flush=True)
0