結果

問題 No.2577 Simple Permutation Guess
ユーザー fiblonariafiblonaria
提出日時 2023-12-09 09:30:39
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 767 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 97,616 KB
平均クエリ数 190.38
最終ジャッジ日時 2023-12-09 09:31:54
合計ジャッジ時間 71,726 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
69,468 KB
testcase_01 AC 1,393 ms
95,828 KB
testcase_02 AC 216 ms
91,808 KB
testcase_03 AC 62 ms
69,468 KB
testcase_04 AC 386 ms
91,936 KB
testcase_05 AC 477 ms
92,064 KB
testcase_06 TLE -
testcase_07 AC 1,996 ms
96,464 KB
testcase_08 TLE -
testcase_09 TLE -
testcase_10 TLE -
testcase_11 AC 68 ms
75,720 KB
testcase_12 AC 62 ms
69,468 KB
testcase_13 AC 87 ms
82,544 KB
testcase_14 AC 95 ms
78,120 KB
testcase_15 AC 62 ms
69,468 KB
testcase_16 AC 60 ms
69,468 KB
testcase_17 AC 60 ms
69,468 KB
testcase_18 AC 62 ms
69,468 KB
testcase_19 AC 62 ms
69,468 KB
testcase_20 AC 62 ms
69,468 KB
testcase_21 AC 60 ms
69,468 KB
testcase_22 AC 59 ms
69,460 KB
testcase_23 AC 62 ms
69,460 KB
testcase_24 AC 74 ms
69,460 KB
testcase_25 AC 84 ms
69,460 KB
testcase_26 AC 61 ms
69,460 KB
testcase_27 AC 81 ms
69,460 KB
testcase_28 AC 62 ms
69,460 KB
testcase_29 AC 80 ms
69,460 KB
testcase_30 AC 62 ms
69,460 KB
testcase_31 AC 63 ms
69,468 KB
testcase_32 AC 60 ms
69,468 KB
testcase_33 AC 61 ms
69,468 KB
testcase_34 AC 73 ms
69,468 KB
testcase_35 AC 63 ms
69,468 KB
testcase_36 AC 75 ms
69,468 KB
testcase_37 AC 60 ms
69,460 KB
testcase_38 AC 61 ms
69,460 KB
testcase_39 AC 64 ms
69,460 KB
testcase_40 AC 64 ms
69,460 KB
testcase_41 AC 64 ms
69,460 KB
testcase_42 AC 60 ms
69,460 KB
testcase_43 AC 60 ms
69,460 KB
testcase_44 AC 60 ms
69,460 KB
testcase_45 AC 60 ms
69,460 KB
testcase_46 AC 60 ms
69,460 KB
testcase_47 AC 61 ms
69,460 KB
testcase_48 AC 61 ms
69,460 KB
testcase_49 AC 62 ms
69,460 KB
testcase_50 AC 62 ms
69,460 KB
testcase_51 AC 79 ms
69,460 KB
testcase_52 AC 61 ms
69,460 KB
testcase_53 AC 61 ms
69,460 KB
testcase_54 AC 61 ms
69,460 KB
testcase_55 AC 68 ms
69,460 KB
testcase_56 AC 63 ms
69,460 KB
testcase_57 AC 61 ms
69,460 KB
testcase_58 AC 62 ms
69,460 KB
testcase_59 AC 61 ms
69,460 KB
testcase_60 AC 62 ms
69,460 KB
testcase_61 AC 62 ms
69,460 KB
testcase_62 AC 61 ms
69,460 KB
testcase_63 AC 60 ms
69,460 KB
testcase_64 AC 61 ms
69,460 KB
testcase_65 AC 60 ms
69,460 KB
testcase_66 AC 62 ms
69,460 KB
testcase_67 AC 61 ms
69,460 KB
testcase_68 AC 62 ms
69,460 KB
testcase_69 AC 62 ms
69,460 KB
testcase_70 AC 61 ms
69,460 KB
testcase_71 AC 63 ms
69,460 KB
testcase_72 AC 61 ms
69,460 KB
testcase_73 AC 61 ms
69,468 KB
testcase_74 AC 86 ms
80,444 KB
testcase_75 AC 83 ms
80,444 KB
testcase_76 AC 83 ms
80,444 KB
testcase_77 AC 82 ms
80,444 KB
testcase_78 AC 82 ms
80,444 KB
testcase_79 AC 83 ms
80,444 KB
testcase_80 AC 88 ms
82,552 KB
testcase_81 AC 88 ms
82,556 KB
testcase_82 AC 89 ms
82,544 KB
testcase_83 AC 86 ms
82,548 KB
testcase_84 AC 88 ms
82,544 KB
testcase_85 AC 100 ms
82,552 KB
testcase_86 AC 113 ms
84,632 KB
testcase_87 AC 89 ms
84,632 KB
testcase_88 AC 90 ms
84,632 KB
testcase_89 AC 91 ms
84,632 KB
testcase_90 AC 91 ms
84,632 KB
testcase_91 AC 90 ms
84,632 KB
testcase_92 AC 1,440 ms
94,876 KB
testcase_93 AC 1,208 ms
95,108 KB
testcase_94 AC 1,131 ms
94,740 KB
testcase_95 AC 1,857 ms
96,104 KB
testcase_96 AC 1,898 ms
96,768 KB
testcase_97 AC 1,691 ms
95,880 KB
testcase_98 AC 1,667 ms
95,992 KB
testcase_99 AC 1,751 ms
95,660 KB
testcase_100 AC 1,226 ms
94,596 KB
testcase_101 AC 1,690 ms
95,588 KB
evil_1_rnd_1.txt TLE -
evil_1_rnd_2.txt TLE -
evil_2_big_1.txt TLE -
evil_2_big_2.txt TLE -
evil_2_big_3.txt TLE -
evil_3_sorted_1.txt TLE -
evil_4_sorted_rev_1.txt TLE -
evil_4_sorted_rev_2.txt TLE -
evil_400_sorted.txt TLE -
evil_400_sorted_rev.txt TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys


def perm(N, ord, fac):
    L = [None for i in range(N)]
    for i in range(N):
        L[i] = ord // fac[N - i - 1]
        ord %= fac[N - i - 1]
    ans = [None for i in range(N)]
    used = [1 for i in range(N)]
    for i in range(N):
        temp = 0
        for j in range(N):
            temp += used[j]
            if temp == L[i] + 1:
                ans[i] = j + 1
                used[j] = 0
                break
    return ans


N = int(input())
fac = [1 for i in range(N)]
for i in range(1, N):
    fac[i] = fac[i - 1] * i
m = [0, fac[N - 1] * N]
while m[1] - m[0] > 1:
    mid = (m[0] + m[1]) // 2
    perm_mid = perm(N, mid, fac)
    print('?', *perm_mid)
    sys.stdout.flush()
    m[1 - int(input())] = mid
print('!', *perm(N, m[0], fac))
0