結果
問題 | No.967 引き算をして門松列(その2) |
ユーザー | yomo3 |
提出日時 | 2020-01-22 12:35:47 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 652 bytes |
コンパイル時間 | 96 ms |
コンパイル使用メモリ | 10,948 KB |
実行使用メモリ | 8,348 KB |
最終ジャッジ日時 | 2023-09-22 05:33:16 |
合計ジャッジ時間 | 1,858 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 18 ms
7,784 KB |
testcase_01 | AC | 18 ms
7,748 KB |
testcase_02 | WA | - |
testcase_03 | AC | 50 ms
8,280 KB |
testcase_04 | AC | 49 ms
8,164 KB |
testcase_05 | AC | 50 ms
8,236 KB |
testcase_06 | AC | 50 ms
8,176 KB |
testcase_07 | AC | 50 ms
8,240 KB |
testcase_08 | AC | 75 ms
8,328 KB |
testcase_09 | AC | 102 ms
8,324 KB |
testcase_10 | WA | - |
testcase_11 | WA | - |
ソースコード
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)