結果
問題 | No.2309 [Cherry 5th Tune D] 夏の先取り |
ユーザー | mkawa2 |
提出日時 | 2023-05-19 22:40:20 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,765 bytes |
コンパイル時間 | 317 ms |
コンパイル使用メモリ | 82,480 KB |
実行使用メモリ | 76,292 KB |
最終ジャッジ日時 | 2024-05-10 06:07:39 |
合計ジャッジ時間 | 7,594 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 52 ms
63,616 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | AC | 115 ms
74,752 KB |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 102 ms
75,008 KB |
testcase_08 | AC | 102 ms
75,008 KB |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | AC | 114 ms
74,880 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | AC | 150 ms
75,008 KB |
testcase_32 | AC | 172 ms
75,136 KB |
testcase_33 | AC | 161 ms
75,136 KB |
testcase_34 | AC | 153 ms
74,880 KB |
testcase_35 | AC | 165 ms
74,752 KB |
testcase_36 | WA | - |
testcase_37 | AC | 50 ms
52,608 KB |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | WA | - |
testcase_42 | AC | 117 ms
74,496 KB |
testcase_43 | AC | 116 ms
74,496 KB |
testcase_44 | AC | 101 ms
74,752 KB |
testcase_45 | AC | 106 ms
74,624 KB |
testcase_46 | AC | 96 ms
74,368 KB |
testcase_47 | AC | 65 ms
69,760 KB |
testcase_48 | AC | 54 ms
60,288 KB |
testcase_49 | AC | 77 ms
74,240 KB |
ソースコード
import sys # sys.setrecursionlimit(200005) # sys.set_int_max_str_digits(200005) int1 = lambda x: int(x)-1 pDB = lambda *x: print(*x, end="\n", file=sys.stderr) p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr) def II(): return int(sys.stdin.readline()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def LI1(): return list(map(int1, sys.stdin.readline().split())) def LLI1(rows_number): return [LI1() for _ in range(rows_number)] def SI(): return sys.stdin.readline().rstrip() dij = [(0, 1), (-1, 0), (0, -1), (1, 0)] # dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)] inf = (1 << 63)-1 md = 10**9+7 # md = 998244353 def solve(): a, b, c = LI() x, y, z, w = LI() ans = 0 if x+y+z >= w*2: pre = 0 for _ in range(2): for i in range(min(a, b)+1): j = min(b-i, c) k = min(a-i, c-j) cur = x*i+y*j+z*k+pre if cur > ans: ans = cur k = min(a-i, c) j = min(b-i, c-k) cur = x*i+y*j+z*k+pre if cur > ans: ans = cur if a and b and c: a, b, c = a-1, b-1, c-1 pre = w else: for l in range(min(a, b, c)+1): i = min(a-l, b-l) j = min(b-l-i, c-l) cur = x*i+y*j if cur > ans: ans = cur j = min(b-l, c-l) k = min(c-l-j, a-l) cur = y*j+z*k if cur > ans: ans = cur i = min(a-l, b-l) k = min(a-l-i, c-l) cur = x*i+z*k if cur > ans: ans = cur print(ans) for _ in range(II()): solve()