結果
| 問題 |
No.967 引き算をして門松列(その2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-01-22 12:35:47 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 652 bytes |
| コンパイル時間 | 83 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-07-07 22:14:09 |
| 合計ジャッジ時間 | 1,967 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 7 WA * 3 |
ソースコード
INF = 10**9
def f213(a,b,c,x,y,z):
res = 0
if a >= b:
d = a - b + 1
a -= d
res += d * x
if c >= a:
d = c - a + 1
c -= d
res += d * z
return res if c > 0 else INF
def f132(a,b,c,x,y,z):
res = 0
if c >= a:
d = c - a + 1
c -= d
res += d * z
if b >= c:
d = b - c + 1
b -= d
res += d * y
return res if b > 0 else INF
for _ in range(int(input())):
a, b, c, x, y, z = map(int, input().split())
ans = min(f213(a,b,c,x,y,z),f213(c,b,a,z,y,x),f132(a,b,c,x,y,z),f132(c,b,a,z,y,x))
if ans == INF: ans = -1
print(ans)