結果
問題 | No.5018 Let's Make a Best-seller Book |
ユーザー | ra5anchor |
提出日時 | 2024-10-04 07:52:12 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 3,724 bytes |
コンパイル時間 | 170 ms |
コンパイル使用メモリ | 82,192 KB |
実行使用メモリ | 97,112 KB |
スコア | 130 |
平均クエリ数 | 7.68 |
最終ジャッジ日時 | 2024-10-04 07:52:33 |
合計ジャッジ時間 | 20,010 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | RE | - |
testcase_01 | RE | - |
testcase_02 | RE | - |
testcase_03 | RE | - |
testcase_04 | RE | - |
testcase_05 | RE | - |
testcase_06 | RE | - |
testcase_07 | RE | - |
testcase_08 | RE | - |
testcase_09 | RE | - |
testcase_10 | RE | - |
testcase_11 | RE | - |
testcase_12 | RE | - |
testcase_13 | RE | - |
testcase_14 | RE | - |
testcase_15 | RE | - |
testcase_16 | RE | - |
testcase_17 | RE | - |
testcase_18 | RE | - |
testcase_19 | RE | - |
testcase_20 | RE | - |
testcase_21 | RE | - |
testcase_22 | RE | - |
testcase_23 | RE | - |
testcase_24 | RE | - |
testcase_25 | RE | - |
testcase_26 | RE | - |
testcase_27 | RE | - |
testcase_28 | RE | - |
testcase_29 | RE | - |
testcase_30 | RE | - |
testcase_31 | RE | - |
testcase_32 | RE | - |
testcase_33 | RE | - |
testcase_34 | RE | - |
testcase_35 | RE | - |
testcase_36 | RE | - |
testcase_37 | RE | - |
testcase_38 | RE | - |
testcase_39 | RE | - |
testcase_40 | RE | - |
testcase_41 | RE | - |
testcase_42 | RE | - |
testcase_43 | RE | - |
testcase_44 | RE | - |
testcase_45 | RE | - |
testcase_46 | RE | - |
testcase_47 | AC | 150 ms
96,472 KB |
testcase_48 | RE | - |
testcase_49 | RE | - |
testcase_50 | RE | - |
testcase_51 | RE | - |
testcase_52 | RE | - |
testcase_53 | RE | - |
testcase_54 | RE | - |
testcase_55 | RE | - |
testcase_56 | RE | - |
testcase_57 | RE | - |
testcase_58 | RE | - |
testcase_59 | RE | - |
testcase_60 | RE | - |
testcase_61 | RE | - |
testcase_62 | RE | - |
testcase_63 | RE | - |
testcase_64 | RE | - |
testcase_65 | RE | - |
testcase_66 | RE | - |
testcase_67 | RE | - |
testcase_68 | RE | - |
testcase_69 | RE | - |
testcase_70 | RE | - |
testcase_71 | RE | - |
testcase_72 | AC | 153 ms
96,076 KB |
testcase_73 | RE | - |
testcase_74 | RE | - |
testcase_75 | RE | - |
testcase_76 | RE | - |
testcase_77 | RE | - |
testcase_78 | RE | - |
testcase_79 | RE | - |
testcase_80 | RE | - |
testcase_81 | RE | - |
testcase_82 | RE | - |
testcase_83 | RE | - |
testcase_84 | RE | - |
testcase_85 | RE | - |
testcase_86 | RE | - |
testcase_87 | RE | - |
testcase_88 | RE | - |
testcase_89 | RE | - |
testcase_90 | RE | - |
testcase_91 | RE | - |
testcase_92 | RE | - |
testcase_93 | RE | - |
testcase_94 | RE | - |
testcase_95 | RE | - |
testcase_96 | RE | - |
testcase_97 | RE | - |
testcase_98 | RE | - |
testcase_99 | RE | - |
ソースコード
import copy import random from time import perf_counter import argparse import sys import math class TimeKeeper: def __init__(self): self.start_time = perf_counter() def is_time_over(self, LIMIT): return (perf_counter() - self.start_time) >= LIMIT def time_now(self): return (perf_counter() - self.start_time) ########################################### def main(DEBUG): tk = TimeKeeper() if DEBUG == True: LIMIT = 0.3 else: LIMIT = 0.3 Lin = list(map(int, input().split())) T = Lin[0] N = Lin[1] money = 2000000 # T = 52 ターン # N = 10 店の数 if DEBUG: # 隠しデータ D = [] # 売れやすさ 0.5 <= d <1.5 for i in range(N): d = float(input()) D.append(d) Z = [] # 0.75 < z < 1.25 for i in range(T): z = list(map(float, input().split())) Z.append(z) p_book0 = 500 # 本の原価 p_adv = 500000 # 広告の単価 p_book1 = 1000 # 本の販売価格 Stot = 0 # 売上冊数 # 初期値 S = [0] * N P = [0] * N R = [0] * N prev = 0 # インタラクティブ for week in range(T): print(f'=== WEEK === {week}', file=sys.stderr) # (あ) 出版社の行動を出力する x = 0 L = [0]*N Lprev = [0]*N # 広告をうつ if money > p_adv * 2: x = 1 cost = p_adv while cost < money//2: x += 1 cost = p_adv * 2**(x-1) print("2", x, flush=True) print("adv book", x, file=sys.stderr) cost = p_adv * 2**(x-1) prev = 2 for i in range(N): Lprev[i] = max(0, S[i] * 3 - R[i]) # 1:本を発送 else: for i in range(N): if S[i] == 0 and R[i] == 0: L[i] = 1 else: # L[i] = max(0, S[i] * 3 - R[i]) if prev == 2: L[i] = Lprev[i] else: L[i] = max(0, S[i] * 3 - R[i]) print("1", *L, flush=True) print("send book", L, file=sys.stderr) cost = sum(L) * p_book0 prev = 1 # (い) 売上部数などを入力する if DEBUG == False: money = int(input()) # 所持金 S = list(map(int, input().split())) # 各書店でこの週に売れた部数 P = list(map(int, input().split())) # 各書店での人気度 R = list(map(int, input().split())) # 各書店での在庫数 else: money -= cost for i in range(N): P[i] = max(-60, min(60, P[i]+x)) R[i] += L[i] S[i] = int(min(R[i], (R[i]**0.5) * (1.05 ** P[i]) * D[i] * Z[week][i])) money += S[i] * p_book1 Stot += S[i] if R[i] != 0 and S[i] >= 0.3 * R[i]: P[i] = min(60, P[i]+1) elif R[i] != 0 and S[i] < 0.1 * R[i]: P[i] = max(-60, P[i]-1) R[i] -= S[i] print(f"Stot: {Stot}", file=sys.stderr) print(f"money: {money:,}", file=sys.stderr) print(f"sell: {S}", file=sys.stderr) print(f"popular: {P}", file=sys.stderr) print(f"remain: {R}", file=sys.stderr) if __name__ == '__main__': parser = argparse.ArgumentParser(description='Debug mode') parser.add_argument('--debug', action='store_true', help='Enable debug mode') args = parser.parse_args() main(args.debug)