結果

問題 No.5018 Let's Make a Best-seller Book
ユーザー すぎぱもすぎぱも
提出日時 2023-10-01 15:04:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 134 ms / 400 ms
コード長 931 bytes
コンパイル時間 437 ms
コンパイル使用メモリ 86,984 KB
実行使用メモリ 92,612 KB
スコア 3,205
平均クエリ数 52.00
最終ジャッジ日時 2023-10-01 15:04:40
合計ジャッジ時間 17,524 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
91,872 KB
testcase_01 AC 111 ms
92,360 KB
testcase_02 AC 110 ms
92,064 KB
testcase_03 AC 109 ms
91,900 KB
testcase_04 AC 111 ms
92,104 KB
testcase_05 AC 109 ms
92,020 KB
testcase_06 AC 112 ms
92,316 KB
testcase_07 AC 117 ms
91,632 KB
testcase_08 AC 110 ms
92,104 KB
testcase_09 AC 112 ms
92,348 KB
testcase_10 AC 112 ms
91,796 KB
testcase_11 AC 111 ms
91,764 KB
testcase_12 AC 110 ms
91,744 KB
testcase_13 AC 111 ms
91,932 KB
testcase_14 AC 110 ms
92,044 KB
testcase_15 AC 113 ms
92,032 KB
testcase_16 AC 112 ms
92,308 KB
testcase_17 AC 112 ms
92,112 KB
testcase_18 AC 110 ms
92,308 KB
testcase_19 AC 110 ms
91,960 KB
testcase_20 AC 110 ms
91,772 KB
testcase_21 AC 110 ms
91,728 KB
testcase_22 AC 110 ms
92,316 KB
testcase_23 AC 116 ms
92,152 KB
testcase_24 AC 109 ms
92,060 KB
testcase_25 AC 109 ms
92,560 KB
testcase_26 AC 110 ms
92,356 KB
testcase_27 AC 109 ms
92,056 KB
testcase_28 AC 109 ms
92,096 KB
testcase_29 AC 112 ms
92,360 KB
testcase_30 AC 111 ms
92,100 KB
testcase_31 AC 112 ms
92,012 KB
testcase_32 AC 109 ms
91,776 KB
testcase_33 AC 109 ms
91,832 KB
testcase_34 AC 109 ms
92,348 KB
testcase_35 AC 109 ms
91,944 KB
testcase_36 AC 110 ms
92,284 KB
testcase_37 AC 110 ms
91,884 KB
testcase_38 AC 110 ms
92,080 KB
testcase_39 AC 109 ms
91,952 KB
testcase_40 AC 119 ms
92,220 KB
testcase_41 AC 110 ms
92,100 KB
testcase_42 AC 110 ms
91,644 KB
testcase_43 AC 110 ms
92,036 KB
testcase_44 AC 111 ms
91,884 KB
testcase_45 AC 111 ms
92,052 KB
testcase_46 AC 110 ms
91,736 KB
testcase_47 AC 109 ms
92,384 KB
testcase_48 AC 134 ms
92,360 KB
testcase_49 AC 108 ms
92,220 KB
testcase_50 AC 110 ms
91,924 KB
testcase_51 AC 109 ms
91,708 KB
testcase_52 AC 109 ms
91,900 KB
testcase_53 AC 109 ms
92,332 KB
testcase_54 AC 109 ms
92,276 KB
testcase_55 AC 111 ms
92,116 KB
testcase_56 AC 124 ms
92,092 KB
testcase_57 AC 108 ms
91,952 KB
testcase_58 AC 109 ms
91,932 KB
testcase_59 AC 111 ms
92,264 KB
testcase_60 AC 112 ms
92,612 KB
testcase_61 AC 112 ms
91,812 KB
testcase_62 AC 112 ms
92,176 KB
testcase_63 AC 112 ms
92,396 KB
testcase_64 AC 115 ms
91,796 KB
testcase_65 AC 110 ms
91,888 KB
testcase_66 AC 110 ms
92,288 KB
testcase_67 AC 110 ms
92,424 KB
testcase_68 AC 112 ms
92,284 KB
testcase_69 AC 109 ms
91,876 KB
testcase_70 AC 113 ms
91,860 KB
testcase_71 AC 111 ms
91,900 KB
testcase_72 AC 114 ms
92,092 KB
testcase_73 AC 108 ms
92,240 KB
testcase_74 AC 111 ms
91,708 KB
testcase_75 AC 108 ms
92,188 KB
testcase_76 AC 112 ms
91,928 KB
testcase_77 AC 113 ms
92,556 KB
testcase_78 AC 111 ms
92,260 KB
testcase_79 AC 110 ms
92,180 KB
testcase_80 AC 116 ms
92,184 KB
testcase_81 AC 111 ms
92,232 KB
testcase_82 AC 111 ms
91,980 KB
testcase_83 AC 112 ms
91,948 KB
testcase_84 AC 111 ms
92,548 KB
testcase_85 AC 109 ms
92,192 KB
testcase_86 AC 110 ms
92,404 KB
testcase_87 AC 111 ms
92,296 KB
testcase_88 AC 126 ms
92,140 KB
testcase_89 AC 112 ms
91,676 KB
testcase_90 AC 112 ms
92,192 KB
testcase_91 AC 110 ms
92,348 KB
testcase_92 AC 110 ms
92,188 KB
testcase_93 AC 111 ms
92,136 KB
testcase_94 AC 111 ms
92,064 KB
testcase_95 AC 111 ms
92,044 KB
testcase_96 AC 117 ms
91,636 KB
testcase_97 AC 110 ms
92,552 KB
testcase_98 AC 109 ms
92,580 KB
testcase_99 AC 111 ms
91,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T, N, money = map(int, input().split())
s, p, r = [0] * N, [0] * N, [0] * N


def softmax(x):
    import math
    max_x = max(x)
    exp_x = [e - max_x for e in x]
    exp_x = [math.exp(e) for e in exp_x]
    softmax_values = [e / sum(exp_x) for e in exp_x]
    return softmax_values


def do(arg):
    if type(arg) == list:
        print(1, *arg, flush=True)
    else:
        print(2, arg, flush=True)
    money = int(input())
    if money == -1:
        exit()
    s = list(map(int, input().split()))
    p = list(map(int, input().split()))
    r = list(map(int, input().split()))
    return money, s, p, r


money, s, p, r = do([money // (500 * N)] * N)

for week in range(T - 1):
    pmax = max(p)
    pay = [pmax - p for p in p]
    pay = [money * s for s in softmax(pay)]
    pay = [max(0, int(p) // 500 - 1 - r) for p, r in zip(pay, r)]
    money, s, p, r = do(pay)


# 20 20 20 20 20 20 20 20 20 20
# 1 2 3 4 5 6 7 8 9 10
0