結果

問題 No.2577 Simple Permutation Guess
ユーザー titiatitia
提出日時 2023-12-05 05:49:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,571 ms / 2,000 ms
コード長 683 bytes
コンパイル時間 1,576 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 94,108 KB
平均クエリ数 248.84
最終ジャッジ日時 2023-12-05 05:51:04
合計ジャッジ時間 63,898 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
69,468 KB
testcase_01 AC 1,057 ms
92,936 KB
testcase_02 AC 190 ms
91,904 KB
testcase_03 AC 59 ms
69,468 KB
testcase_04 AC 304 ms
91,920 KB
testcase_05 AC 398 ms
91,904 KB
testcase_06 AC 1,568 ms
93,352 KB
testcase_07 AC 1,504 ms
93,204 KB
testcase_08 AC 1,522 ms
93,332 KB
testcase_09 AC 1,548 ms
93,232 KB
testcase_10 AC 1,571 ms
93,332 KB
testcase_11 AC 64 ms
75,840 KB
testcase_12 AC 57 ms
69,468 KB
testcase_13 AC 79 ms
82,536 KB
testcase_14 AC 72 ms
78,236 KB
testcase_15 AC 60 ms
69,468 KB
testcase_16 AC 57 ms
69,468 KB
testcase_17 AC 60 ms
69,468 KB
testcase_18 AC 57 ms
69,468 KB
testcase_19 AC 57 ms
69,468 KB
testcase_20 AC 59 ms
69,468 KB
testcase_21 AC 56 ms
69,468 KB
testcase_22 AC 58 ms
69,460 KB
testcase_23 AC 58 ms
69,460 KB
testcase_24 AC 61 ms
69,460 KB
testcase_25 AC 60 ms
69,460 KB
testcase_26 AC 59 ms
69,460 KB
testcase_27 AC 60 ms
69,460 KB
testcase_28 AC 60 ms
69,460 KB
testcase_29 AC 60 ms
69,460 KB
testcase_30 AC 58 ms
69,460 KB
testcase_31 AC 58 ms
69,468 KB
testcase_32 AC 60 ms
69,468 KB
testcase_33 AC 63 ms
69,468 KB
testcase_34 AC 59 ms
69,468 KB
testcase_35 AC 60 ms
69,468 KB
testcase_36 AC 59 ms
69,468 KB
testcase_37 AC 58 ms
69,460 KB
testcase_38 AC 58 ms
69,460 KB
testcase_39 AC 57 ms
69,460 KB
testcase_40 AC 61 ms
69,460 KB
testcase_41 AC 58 ms
69,460 KB
testcase_42 AC 58 ms
69,460 KB
testcase_43 AC 58 ms
69,460 KB
testcase_44 AC 58 ms
69,460 KB
testcase_45 AC 58 ms
69,460 KB
testcase_46 AC 57 ms
69,460 KB
testcase_47 AC 58 ms
69,460 KB
testcase_48 AC 58 ms
69,460 KB
testcase_49 AC 57 ms
69,460 KB
testcase_50 AC 57 ms
69,460 KB
testcase_51 AC 58 ms
69,460 KB
testcase_52 AC 61 ms
69,460 KB
testcase_53 AC 58 ms
69,460 KB
testcase_54 AC 58 ms
69,460 KB
testcase_55 AC 57 ms
69,460 KB
testcase_56 AC 57 ms
69,460 KB
testcase_57 AC 59 ms
69,460 KB
testcase_58 AC 59 ms
69,460 KB
testcase_59 AC 58 ms
69,460 KB
testcase_60 AC 58 ms
69,460 KB
testcase_61 AC 62 ms
69,460 KB
testcase_62 AC 59 ms
69,460 KB
testcase_63 AC 59 ms
69,460 KB
testcase_64 AC 63 ms
69,456 KB
testcase_65 AC 57 ms
69,460 KB
testcase_66 AC 58 ms
69,460 KB
testcase_67 AC 58 ms
69,460 KB
testcase_68 AC 58 ms
69,460 KB
testcase_69 AC 57 ms
69,460 KB
testcase_70 AC 57 ms
69,460 KB
testcase_71 AC 59 ms
69,460 KB
testcase_72 AC 58 ms
69,460 KB
testcase_73 AC 59 ms
69,468 KB
testcase_74 AC 75 ms
80,432 KB
testcase_75 AC 76 ms
80,432 KB
testcase_76 AC 81 ms
80,432 KB
testcase_77 AC 77 ms
80,432 KB
testcase_78 AC 75 ms
80,432 KB
testcase_79 AC 75 ms
80,432 KB
testcase_80 AC 79 ms
80,424 KB
testcase_81 AC 78 ms
80,432 KB
testcase_82 AC 81 ms
80,428 KB
testcase_83 AC 78 ms
80,432 KB
testcase_84 AC 79 ms
80,428 KB
testcase_85 AC 77 ms
80,432 KB
testcase_86 AC 85 ms
82,536 KB
testcase_87 AC 80 ms
82,536 KB
testcase_88 AC 82 ms
82,536 KB
testcase_89 AC 109 ms
82,536 KB
testcase_90 AC 85 ms
84,616 KB
testcase_91 AC 83 ms
82,536 KB
testcase_92 AC 1,090 ms
92,920 KB
testcase_93 AC 978 ms
92,800 KB
testcase_94 AC 878 ms
92,792 KB
testcase_95 AC 1,402 ms
94,108 KB
testcase_96 AC 1,508 ms
93,696 KB
testcase_97 AC 1,277 ms
93,072 KB
testcase_98 AC 1,262 ms
93,048 KB
testcase_99 AC 1,381 ms
93,440 KB
testcase_100 AC 933 ms
92,800 KB
testcase_101 AC 1,280 ms
93,072 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 AC 1,315 ms
93,200 KB
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 #

n=int(input())


P=[1]
for i in range(1,n+1):
    P.append(P[-1]*i)
               
OK=1
NG=P[-1]+1

def calc(x):
    x-=1
    ANS=[]
    USE=[0]*(n+1)
    for i in range(n-1,-1,-1):
        k=x//P[i]
        #print(x,k,USE)
        x=x%P[i]

        for j in range(n+1):
            if USE[j]==0:
                k-=1

                if k==-1:
                    ANS.append(j+1)
                    USE[j]=1
                    break

    return ANS
        

while NG>OK+1:
    mid=(OK+NG)//2

    print("?",*calc(mid),flush=True)

    ret=int(input())

    if ret==-1:
        exit()

    if ret==1:
        OK=mid
    else:
        NG=mid

print("!",*calc(OK),flush=True)
    
0