結果

問題 No.63 ポッキーゲーム
ユーザー ゆうPゆうP
提出日時 2024-03-09 20:30:58
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 349 bytes
コンパイル時間 10,608 ms
コンパイル使用メモリ 214,164 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-03-09 20:31:10
合計ジャッジ時間 11,432 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,676 KB
testcase_01 AC 1 ms
6,676 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 1 ms
6,676 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 1 ms
6,676 KB
testcase_14 WA -
testcase_15 AC 1 ms
6,676 KB
testcase_16 AC 1 ms
6,676 KB
testcase_17 AC 1 ms
6,676 KB
testcase_18 AC 1 ms
6,676 KB
testcase_19 AC 1 ms
6,676 KB
testcase_20 AC 1 ms
6,676 KB
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

// No.63 ポッキーゲーム
package main

import (
	"fmt"
	"math"
)

func main() {
	var L, K int // ポッキーの長さ、齧る長さ
	fmt.Scan(&L, &K)

	ans := 0
	if (K * 2) >= L {
		ans = 0
	} else if int(L/(K*2)) != int(math.Ceil(float64(L/(K*2)))) {
		ans = K * int(L/(K*2))
	} else {
		ans = K * (int(L/(K*2)) - 1)
	}
	fmt.Println(ans)
}
0