結果

問題 No.5018 Let's Make a Best-seller Book
ユーザー trineutrontrineutron
提出日時 2023-09-24 01:14:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 52 ms / 400 ms
コード長 1,672 bytes
コンパイル時間 117 ms
コンパイル使用メモリ 10,968 KB
実行使用メモリ 24,464 KB
スコア 4,601
平均クエリ数 52.00
最終ジャッジ日時 2023-10-01 12:31:59
合計ジャッジ時間 9,787 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
23,792 KB
testcase_01 AC 50 ms
23,700 KB
testcase_02 AC 48 ms
23,712 KB
testcase_03 AC 47 ms
24,372 KB
testcase_04 AC 48 ms
23,800 KB
testcase_05 AC 47 ms
24,400 KB
testcase_06 AC 46 ms
23,696 KB
testcase_07 AC 47 ms
24,428 KB
testcase_08 AC 48 ms
24,464 KB
testcase_09 AC 47 ms
24,104 KB
testcase_10 AC 48 ms
23,712 KB
testcase_11 AC 46 ms
24,440 KB
testcase_12 AC 45 ms
24,440 KB
testcase_13 AC 48 ms
24,180 KB
testcase_14 AC 46 ms
23,712 KB
testcase_15 AC 46 ms
24,076 KB
testcase_16 AC 47 ms
24,140 KB
testcase_17 AC 46 ms
23,772 KB
testcase_18 AC 46 ms
23,904 KB
testcase_19 AC 46 ms
23,996 KB
testcase_20 AC 46 ms
24,236 KB
testcase_21 AC 46 ms
23,672 KB
testcase_22 AC 46 ms
24,232 KB
testcase_23 AC 45 ms
23,636 KB
testcase_24 AC 46 ms
24,320 KB
testcase_25 AC 47 ms
24,336 KB
testcase_26 AC 46 ms
24,360 KB
testcase_27 AC 50 ms
23,840 KB
testcase_28 AC 46 ms
24,360 KB
testcase_29 AC 46 ms
23,820 KB
testcase_30 AC 45 ms
24,404 KB
testcase_31 AC 48 ms
24,344 KB
testcase_32 AC 45 ms
23,848 KB
testcase_33 AC 47 ms
24,260 KB
testcase_34 AC 46 ms
24,100 KB
testcase_35 AC 47 ms
23,772 KB
testcase_36 AC 47 ms
23,696 KB
testcase_37 AC 46 ms
24,328 KB
testcase_38 AC 49 ms
23,820 KB
testcase_39 AC 45 ms
24,096 KB
testcase_40 AC 46 ms
24,008 KB
testcase_41 AC 46 ms
24,084 KB
testcase_42 AC 47 ms
24,384 KB
testcase_43 AC 45 ms
24,344 KB
testcase_44 AC 47 ms
24,124 KB
testcase_45 AC 46 ms
23,828 KB
testcase_46 AC 46 ms
23,864 KB
testcase_47 AC 46 ms
23,804 KB
testcase_48 AC 49 ms
24,372 KB
testcase_49 AC 46 ms
23,920 KB
testcase_50 AC 47 ms
24,020 KB
testcase_51 AC 45 ms
23,968 KB
testcase_52 AC 47 ms
23,796 KB
testcase_53 AC 48 ms
24,160 KB
testcase_54 AC 48 ms
24,336 KB
testcase_55 AC 45 ms
23,868 KB
testcase_56 AC 45 ms
23,816 KB
testcase_57 AC 47 ms
23,868 KB
testcase_58 AC 47 ms
24,436 KB
testcase_59 AC 52 ms
24,312 KB
testcase_60 AC 48 ms
24,360 KB
testcase_61 AC 46 ms
24,148 KB
testcase_62 AC 46 ms
24,128 KB
testcase_63 AC 45 ms
23,940 KB
testcase_64 AC 46 ms
24,108 KB
testcase_65 AC 46 ms
23,988 KB
testcase_66 AC 45 ms
24,000 KB
testcase_67 AC 46 ms
23,752 KB
testcase_68 AC 46 ms
23,936 KB
testcase_69 AC 46 ms
23,660 KB
testcase_70 AC 46 ms
23,688 KB
testcase_71 AC 47 ms
23,708 KB
testcase_72 AC 48 ms
24,448 KB
testcase_73 AC 46 ms
24,088 KB
testcase_74 AC 50 ms
23,808 KB
testcase_75 AC 46 ms
23,720 KB
testcase_76 AC 46 ms
24,128 KB
testcase_77 AC 46 ms
23,804 KB
testcase_78 AC 47 ms
24,244 KB
testcase_79 AC 46 ms
24,336 KB
testcase_80 AC 46 ms
23,836 KB
testcase_81 AC 46 ms
23,868 KB
testcase_82 AC 47 ms
24,112 KB
testcase_83 AC 48 ms
24,360 KB
testcase_84 AC 45 ms
24,264 KB
testcase_85 AC 45 ms
24,432 KB
testcase_86 AC 48 ms
23,660 KB
testcase_87 AC 46 ms
23,664 KB
testcase_88 AC 48 ms
23,784 KB
testcase_89 AC 47 ms
23,656 KB
testcase_90 AC 48 ms
23,820 KB
testcase_91 AC 47 ms
24,348 KB
testcase_92 AC 45 ms
24,040 KB
testcase_93 AC 46 ms
23,780 KB
testcase_94 AC 45 ms
23,944 KB
testcase_95 AC 45 ms
23,784 KB
testcase_96 AC 47 ms
24,156 KB
testcase_97 AC 47 ms
24,312 KB
testcase_98 AC 46 ms
24,184 KB
testcase_99 AC 46 ms
23,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 最初の入力
T, N, money = map(int, input().split())

assert T == 52
assert N == 10
assert money == 2000000

S = [0] * N
P = [0] * N
R = [0] * N

# インタラクティブ
for week in range(T):
    # (あ) 出版社の行動を出力する
    if min(R) > 0 and money >= 500000:
        x = min(5, (money // 500000).bit_length())
        money_prev = money - 500000 * 2 ** (x - 1)
        assert money_prev >= 0
        P_prev = [min(60, P[i] + x) for i in range(N)]
        R_prev = R
        print("2", x, flush=True)
    else:
        L = [money // (5000 * N)] * N
        assert min(L) >= 0
        money_prev = money - 500 * sum(L)
        assert money_prev >= 0
        P_prev = P
        R_prev = [R[i] + L[i] for i in range(N)]
        print("1", *L, flush=True)

    # (い) 売上部数などを入力する
    money = int(input())
    S = list(map(int, input().split()))
    P = list(map(int, input().split()))
    R = list(map(int, input().split()))
    assert len(S) == N
    assert len(P) == N
    assert len(R) == N
    assert money == money_prev + 1000 * sum(S)
    assert -60 <= min(P) and max(P) <= 60
    assert min(R) >= 0

    def calc_S(i, d, r):
        return int(min(R_prev[i], R_prev[i] ** 0.5 * 1.05 ** P_prev[i] * d * r))

    for i in range(N):
        assert calc_S(i, 0.5, 0.75) <= S[i] <= calc_S(i, 1.5, 1.25)
        P_expected = P_prev[i]
        if R_prev[i] != 0 and 10 * S[i] >= 3 * R_prev[i]:
            P_expected += 1
        if R_prev[i] != 0 and 10 * S[i] < R_prev[i]:
            P_expected -= 1
        P_expected = max(-60, min(60, P_expected))
        assert P[i] == P_expected
        assert R[i] == R_prev[i] - S[i]
0