結果

問題 No.2329 Nafmo、イカサマをする
ユーザー titiatitia
提出日時 2023-07-25 05:21:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 720 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 82,520 KB
実行使用メモリ 77,624 KB
最終ジャッジ日時 2024-04-09 23:04:22
合計ジャッジ時間 67,968 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
54,176 KB
testcase_01 AC 43 ms
54,644 KB
testcase_02 AC 44 ms
55,312 KB
testcase_03 AC 1,837 ms
77,384 KB
testcase_04 AC 41 ms
54,228 KB
testcase_05 AC 41 ms
54,820 KB
testcase_06 AC 40 ms
54,160 KB
testcase_07 AC 41 ms
56,204 KB
testcase_08 WA -
testcase_09 AC 1,838 ms
76,996 KB
testcase_10 AC 1,839 ms
77,432 KB
testcase_11 AC 1,839 ms
77,352 KB
testcase_12 AC 1,838 ms
77,592 KB
testcase_13 AC 1,838 ms
76,976 KB
testcase_14 AC 1,838 ms
77,088 KB
testcase_15 AC 1,838 ms
77,128 KB
testcase_16 WA -
testcase_17 AC 1,836 ms
77,116 KB
testcase_18 AC 1,838 ms
77,272 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 1,840 ms
77,264 KB
testcase_25 WA -
testcase_26 AC 1,838 ms
77,404 KB
testcase_27 AC 1,837 ms
77,452 KB
testcase_28 AC 1,837 ms
77,624 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 1,838 ms
77,160 KB
testcase_32 AC 1,838 ms
77,016 KB
testcase_33 AC 1,839 ms
77,548 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 1,838 ms
77,292 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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 and M!=MAX:
    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)      
0