結果

問題 No.153 石の山
ユーザー fmhrfmhr
提出日時 2015-07-30 08:39:17
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 408 bytes
コンパイル時間 10,355 ms
コンパイル使用メモリ 239,816 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-22 14:59:44
合計ジャッジ時間 11,233 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

package main

import (
	"fmt"
)

func main() {
	solve()
}


var grundy [100+1]int
func solve(){
	var N int
	fmt.Scan(&N)
	grundy[0]=0
	for i:=2; i<=N; i++ {
	    set := map[int]bool{}
		set[grundy[i/2]^grundy[(i+2)/2]]=true
		if i>=3{
			set[grundy[i/3]^grundy[(i+1)/3]^grundy[(i+2)/3]]=true
		}
		for set[grundy[i]]{
			grundy[i]++
		}
	}
	if grundy[N]!=0{
		fmt.Println("A")
	}else{
		fmt.Println("B")
	}
}
0