結果
| 問題 |
No.5018 Let's Make a Best-seller Book
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2023-10-01 15:35:54 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 146 ms / 400 ms |
| コード長 | 1,734 bytes |
| コンパイル時間 | 322 ms |
| コンパイル使用メモリ | 87,168 KB |
| 実行使用メモリ | 93,852 KB |
| スコア | 77,489 |
| 平均クエリ数 | 52.00 |
| 最終ジャッジ日時 | 2023-10-01 15:36:14 |
| 合計ジャッジ時間 | 17,618 ms |
|
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
| 純コード判定しない問題か言語 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 100 |
ソースコード
import sys
input = sys.stdin.readline
T,N,Money=map(int,input().split())
SELLS=[0]*N
S = [0] * N
P = [0] * N
R = [0] * N
# 序盤は少しだけ売って人気度を上げ、
# 人気度が上がったらたくさん売りさばくのが最適そう。
for tests in range(T):
ALL=Money//500
#ALL=min(ALL,50*(tests+1))
if max(P)>=50:
SUM=sum(SELLS)
ANS=[0]*N
for i in range(N):
ANS[i]=ALL*SELLS[i]//SUM
else:
ANS=[0]*N
for i in range(N):
OK=1
NG=ALL+1
while OK+1<NG:
mid=(OK+NG)//2
if (mid**(0.5))*(1.05**P[i])*0.75>=mid*0.3:
OK=mid
else:
NG=mid
ANS[i]=max(0,OK-R[i])
SUM=sum(ANS)
if SUM>ALL:
for i in range(N):
ANS[i]=ALL*ANS[i]//SUM
if tests<=45 and min(R)!=0 and max(P)<=55 and Money>=8000000:
print(2,5,flush=True)
elif tests<=45 and min(R)!=0 and max(P)<=56 and Money>=4000000:
print(2,4,flush=True)
elif tests<=45 and min(R)!=0 and max(P)<=57 and tests>=5 and Money>=2000000:
print(2,3,flush=True)
elif tests<=45 and min(R)!=0 and max(P)<=58 and tests>=5 and Money>=1000000:
print(2,2,flush=True)
elif tests<=45 and min(R)!=0 and max(P)<=59 and tests>=5 and Money>=500000:
print(2,1,flush=True)
else:
print("1",*ANS,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()))
for i in range(N):
SELLS[i]+=S[i]
titia