結果

問題 No.2390 Udon Coupon (Hard)
ユーザー cleanttedcleantted
提出日時 2023-07-03 13:36:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 611 bytes
コンパイル時間 556 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 76,536 KB
最終ジャッジ日時 2023-09-26 08:04:57
合計ジャッジ時間 6,733 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 77 ms
75,464 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 76 ms
71,216 KB
testcase_07 AC 75 ms
71,112 KB
testcase_08 AC 75 ms
71,404 KB
testcase_09 AC 109 ms
76,128 KB
testcase_10 AC 78 ms
75,608 KB
testcase_11 WA -
testcase_12 AC 72 ms
71,176 KB
testcase_13 AC 77 ms
75,536 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 77 ms
75,580 KB
testcase_24 AC 90 ms
76,072 KB
testcase_25 AC 97 ms
75,940 KB
testcase_26 AC 91 ms
76,232 KB
testcase_27 AC 95 ms
76,072 KB
testcase_28 AC 90 ms
76,256 KB
testcase_29 AC 109 ms
76,096 KB
testcase_30 WA -
testcase_31 AC 109 ms
76,096 KB
testcase_32 AC 110 ms
76,116 KB
testcase_33 AC 109 ms
76,044 KB
testcase_34 AC 136 ms
76,264 KB
testcase_35 AC 135 ms
75,936 KB
testcase_36 AC 132 ms
76,116 KB
testcase_37 AC 136 ms
76,116 KB
testcase_38 AC 137 ms
75,940 KB
testcase_39 WA -
testcase_40 AC 100 ms
76,260 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 78 ms
75,412 KB
testcase_45 AC 84 ms
76,056 KB
testcase_46 AC 78 ms
75,388 KB
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 73 ms
71,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def co_solve(n, a0, b0, a1, b1, a2, b2):
  r = 0
  for i in range(min(a0, n // a1 + 1)):
    d = n - i * a1
    for j in range(a0):
      r = max(r, (d // a0) * b0 + i * b1 + j * b2)
      d -= a2
      if d < 0:
        break
  return r

def main():
  n = int(input())
  a0, b0 = (int(x) for x in input().split())
  a1, b1 = (int(x) for x in input().split())
  a2, b2 = (int(x) for x in input().split())

  result = max(
    co_solve(n, a0, b0, a1, b1, a2, b2),
    0
    # co_solve(n, a1, b1, a2, b2, a0, b0),
   # co_solve(n, a2, b2, a0, b0, a1, b1),
  )
  print(result)

if __name__ == "__main__":
  main()
0