結果

問題 No.3068 Speedrun (Hard)
ユーザー 回転
提出日時 2025-05-22 02:09:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 711 bytes
コンパイル時間 682 ms
コンパイル使用メモリ 82,128 KB
実行使用メモリ 63,752 KB
最終ジャッジ日時 2025-05-22 02:09:56
合計ジャッジ時間 11,638 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 27 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

A,B,C,D,N = list(map(int,input().split()))
P,Q,R,S,T = list(map(int,input().split()))

for a in range(A+1):
    for b in range(B+1):
        nokori = N - (a+b)
        nokori_t = T - (a*P+b*Q)
        if(nokori < 0):break
        if(nokori_t < 0):break
        if(S != R):
            d = (nokori_t - R*nokori)//(S-R)
            c = nokori - d
            if(c <= C and d <= D):
                print(a,b,c,d)
                exit()
        else:
            if(nokori*S != nokori_t):
                #print("hello")
                continue

            c = min(nokori,C)
            nokori -= c
            d = min(nokori,D)
            if(a+b+c+d == N):
                print(a,b,c,d)
                exit()
0