結果
問題 | No.2390 Udon Coupon (Hard) |
ユーザー | cleantted |
提出日時 | 2023-07-15 17:54:50 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,533 bytes |
コンパイル時間 | 347 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 92,800 KB |
最終ジャッジ日時 | 2024-09-17 02:57:59 |
合計ジャッジ時間 | 11,148 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 137 ms
91,904 KB |
testcase_01 | AC | 146 ms
91,904 KB |
testcase_02 | AC | 137 ms
92,416 KB |
testcase_03 | AC | 137 ms
92,476 KB |
testcase_04 | AC | 135 ms
92,288 KB |
testcase_05 | WA | - |
testcase_06 | AC | 130 ms
91,776 KB |
testcase_07 | AC | 136 ms
91,648 KB |
testcase_08 | AC | 139 ms
91,836 KB |
testcase_09 | AC | 381 ms
92,416 KB |
testcase_10 | AC | 141 ms
92,160 KB |
testcase_11 | AC | 138 ms
91,776 KB |
testcase_12 | AC | 139 ms
92,160 KB |
testcase_13 | AC | 140 ms
91,904 KB |
testcase_14 | AC | 139 ms
92,032 KB |
testcase_15 | AC | 136 ms
92,032 KB |
testcase_16 | AC | 139 ms
92,160 KB |
testcase_17 | AC | 136 ms
92,288 KB |
testcase_18 | AC | 134 ms
91,904 KB |
testcase_19 | AC | 137 ms
92,664 KB |
testcase_20 | AC | 134 ms
91,776 KB |
testcase_21 | WA | - |
testcase_22 | AC | 135 ms
92,416 KB |
testcase_23 | AC | 139 ms
92,672 KB |
testcase_24 | AC | 185 ms
92,800 KB |
testcase_25 | AC | 178 ms
92,416 KB |
testcase_26 | AC | 178 ms
92,288 KB |
testcase_27 | AC | 181 ms
92,544 KB |
testcase_28 | AC | 173 ms
92,288 KB |
testcase_29 | AC | 236 ms
92,416 KB |
testcase_30 | AC | 224 ms
92,744 KB |
testcase_31 | AC | 240 ms
92,416 KB |
testcase_32 | AC | 240 ms
92,160 KB |
testcase_33 | AC | 235 ms
92,468 KB |
testcase_34 | AC | 341 ms
92,672 KB |
testcase_35 | AC | 322 ms
92,288 KB |
testcase_36 | AC | 317 ms
92,544 KB |
testcase_37 | AC | 340 ms
92,288 KB |
testcase_38 | AC | 320 ms
92,416 KB |
testcase_39 | AC | 211 ms
92,672 KB |
testcase_40 | AC | 188 ms
92,800 KB |
testcase_41 | AC | 211 ms
92,288 KB |
testcase_42 | AC | 175 ms
92,544 KB |
testcase_43 | AC | 174 ms
92,416 KB |
testcase_44 | AC | 158 ms
92,160 KB |
testcase_45 | AC | 157 ms
92,800 KB |
testcase_46 | AC | 141 ms
92,416 KB |
testcase_47 | AC | 151 ms
92,288 KB |
testcase_48 | AC | 170 ms
92,288 KB |
testcase_49 | AC | 134 ms
91,776 KB |
ソースコード
import sys from collections import deque, Counter from math import gcd, log10, pi, sqrt, ceil from bisect import bisect, bisect_left, bisect_right, insort from typing import Iterable, TypeVar, Union, Tuple, Iterator, List # import bisect import copy import heapq import itertools import math import random from fractions import Fraction from functools import lru_cache, partial, cmp_to_key import operator # import pypyjit # pypyjit.set_param('max_unroll_recursion=-1') # import string # import networkx as nx input = sys.stdin.readline sys.setrecursionlimit(10000000) # mod = 10 ** 9 + 7 mod = 998244353 # mod = 1 << 128 # mod = 10 ** 30 + 1 INF = 1 << 61 DIFF = 10 ** -9 DX = [1, 0, -1, 0, 1, 1, -1, -1] DY = [0, 1, 0, -1, 1, -1, 1, -1] def read_values(): return tuple(map(int, input().split())) def read_index(): return tuple(map(lambda x: int(x) - 1, input().split())) def read_list(): return list(read_values()) def read_lists(N): return [read_list() for _ in range(N)] def main(): N = int(input()) S = read_lists(3) S += S res = 0 for k in range(3): A1, B1 = S[k] A2, B2 = S[k + 1] A3, B3 = S[k + 2] for i in range(A1): N1 = N - A1 * i if N1 < 0: break r1 = i * B1 for j in range(A2): N2 = N1 - A2 * j if N2 < 0: break res = max(res, r1 + j * B2 + (N2 // A3) * B3) print(res) if __name__ == "__main__": main()