結果

問題 No.3068 Speedrun (Hard)
ユーザー PNJ
提出日時 2025-03-22 16:21:50
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 428 bytes
コンパイル時間 474 ms
コンパイル使用メモリ 82,244 KB
実行使用メモリ 67,596 KB
最終ジャッジ日時 2025-03-22 16:22:00
合計ジャッジ時間 10,385 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18 RE * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B, C, D, N = map(int, input().split())
P, Q, R, S, T = map(int, input().split())
for na in range(A + 1):
  for nb in range(B + 1):
    if na + nb > N:
      break
    t = T - P * na - Q * nb + (na + nb - N) * S
    if (R - S) * t < 0:
      continue
    if t % (R - S):
      continue
    nc = t // (R - S)
    if nc > C:
      continue
    nd = N - na - nb - nc
    if 0 <= nd <= D:
      print(na, nb, nc, nd)
      exit()
0