結果
| 問題 |
No.2329 Nafmo、イカサマをする
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2023-07-25 05:19:11 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 711 bytes |
| コンパイル時間 | 341 ms |
| コンパイル使用メモリ | 82,288 KB |
| 実行使用メモリ | 77,980 KB |
| 最終ジャッジ日時 | 2024-10-01 23:39:27 |
| 合計ジャッジ時間 | 70,223 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 RE * 2 |
| other | AC * 17 WA * 19 RE * 4 |
ソースコード
from time import time
time0=time()
from random import randint,random
e=2.718281828
N,M,K=map(int,input().split())
A=list(map(int,input().split()))
A.append(0)
ANS=[0]*K
score=0
MAX=0
last=2
while time()-time0<last-0.2:
x,y=randint(0,K-1),randint(0,N)
before=ANS[x]
plus=A[y]-before
if plus>0 and score+plus<=M:
ANS[x]=A[y]
score+=plus
MAX=max(MAX,score)
elif plus!=0 and score+plus<=M:
mu=e**(plus/(time()-time0)/(M-MAX))
#print(plus,mu)
if mu>random():
ANS[x]=A[y]
score+=plus
MAX=max(MAX,score)
#print(plus,score,MAX,mu)
#print(ANS,score)
print(MAX)
titia