結果
| 問題 |
No.968 引き算をして門松列(その3)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-01-13 21:39:53 |
| 言語 | Kuin (KuinC++ v.2021.9.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,625 bytes |
| コンパイル時間 | 2,253 ms |
| コンパイル使用メモリ | 148,712 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-16 10:15:19 |
| 合計ジャッジ時間 | 3,040 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | WA * 10 |
ソースコード
func main()
var T: int :: cui@input().toInt(&)
for t(1, T)
var ss: [][]char :: cui@input().split(" ")
var AA: int :: ss[0].toInt(&)
var BB: int :: ss[1].toInt(&)
var CC: int :: ss[2].toInt(&)
var x: int :: ss[3].toInt(&)
var y: int :: ss[4].toInt(&)
var z: int :: ss[5].toInt(&)
; Bが最大のとき
var ans1: int :: -1
block
var A: int :: AA
var B: int :: BB
var C: int :: CC
var cnt: int :: 0
if(A = C)
if(x < y)
do cnt :+ x
do A :- 1
do B :- 1
else
do cnt :+ y
do C :- 1
do B :- 1
end if
end if
if(A > C)
if(A >= B)
do cnt :+ (A - (B - 1)) * z
do C :- (A - (B - 1))
do A :- (A - (B - 1))
end if
else
if(C >= B)
do cnt :+ (C - (B - 1)) * z
do A :- (C - (B - 1))
do C :- (C - (B - 1))
end if
end if
if(A > 0 & C > 0 & B > 0)
do ans1 :: cnt
end if
end block
; Bが最小のとき
var ans2: int :: -1
block
var A: int :: AA
var B: int :: BB
var C: int :: CC
var cnt: int :: 0
if(A = C)
do cnt :+ lib@min(x, y)
do A :- 1
do B :- 1
end if
var target: int :: lib@min(A, C)
if(B >= target)
do cnt :+ (B - (target - 1)) * (x + y)
do A :- (B - (target - 1))
do C :- (B - (target - 1))
do B :- (B - (target - 1)) * 2
end if
if(A > 0 & C > 0 & B > 0)
do ans2 :: cnt
end if
end block
var ans: int :: -1
if(ans1 >= 0)
do ans :: ans1
end if
if(ans2 >= 0)
if(ans >= 0)
do ans :: lib@min(ans, ans2)
else
do ans :: ans2
end if
end if
do cui@print("\{ans}\n")
end for
end func