結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー tsuchinagatsuchinaga
提出日時 2019-05-13 09:36:21
言語 Go
(1.22.1)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 432 bytes
コンパイル時間 10,207 ms
コンパイル使用メモリ 211,992 KB
実行使用メモリ 24,432 KB
平均クエリ数 8.00
最終ジャッジ日時 2023-09-23 17:16:47
合計ジャッジ時間 13,582 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
24,036 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 43 ms
24,288 KB
testcase_05 AC 43 ms
23,892 KB
testcase_06 AC 43 ms
23,676 KB
testcase_07 AC 43 ms
23,688 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 44 ms
23,424 KB
testcase_17 WA -
testcase_18 AC 44 ms
24,060 KB
testcase_19 AC 43 ms
23,676 KB
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 -
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import "fmt"

func main() {
	var n, k, m int
	_, _ = fmt.Scan(&n, &k)

	// 勝てる数字の倍数を確認
	l := (n - 1) % (k + 1)
	if l == 0 {
		l = k + 1
	}
	// fmt.Println(l)

	// 勝てる数字を先行で言えるなら言う、言えないなら0にする
	if l <= k {
		fmt.Println(l)
	} else {
		fmt.Println(0)
	}

	for {
		_, _ = fmt.Scan(&m)
		if m >= n {
			return
		}

		fmt.Println((m/l + 1) * l)
	}
}
0