結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー fmhrfmhr
提出日時 2015-07-31 23:46:14
言語 Go
(1.22.1)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 431 bytes
コンパイル時間 11,056 ms
コンパイル使用メモリ 212,564 KB
実行使用メモリ 24,492 KB
平均クエリ数 8.00
最終ジャッジ日時 2023-09-23 05:22:00
合計ジャッジ時間 14,197 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
24,072 KB
testcase_01 AC 43 ms
24,060 KB
testcase_02 WA -
testcase_03 AC 42 ms
24,264 KB
testcase_04 AC 42 ms
24,312 KB
testcase_05 AC 42 ms
24,288 KB
testcase_06 AC 42 ms
23,700 KB
testcase_07 WA -
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 42 ms
24,060 KB
testcase_17 WA -
testcase_18 AC 42 ms
23,736 KB
testcase_19 AC 43 ms
23,520 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() {
	solve()
}

func solve(){
	var N, K int
	fmt.Scan(&N, &K)
	pre := win(N, K)
	//fmt.Println(pre)
	y := 0
	if pre == false{
		fmt.Println("0")
	}else{
		fmt.Println("1")
		y = 1
	}
	x := 0
	for{
		fmt.Scan(&x)
		if x>=N{
			break
		}
		fmt.Println(y+K+1)
		y = y + K + 1
	}
	return
}

func win(n, k int)bool{
	for n > 1{
		n = n - (k + 1)
	}
	if n == 1{
		return false
	}
	return true
}
0