結果

問題 No.351 市松スライドパズル
ユーザー yuki2006yuki2006
提出日時 2016-03-11 23:43:29
言語 Go
(1.22.1)
結果
TLE  
実行時間 -
コード長 513 bytes
コンパイル時間 10,964 ms
コンパイル使用メモリ 227,020 KB
実行使用メモリ 56,928 KB
最終ジャッジ日時 2024-04-19 07:02:15
合計ジャッジ時間 18,923 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

package main

import "fmt"

func main() {
	var H, W, N int
	fmt.Scanf("%d %d", &H, &W)
	fmt.Scanf("%d", &N)
	type SK struct {
		S string
		K int
	}
	SKs := make([]SK, N)
	for i := 0; i < N; i++ {
		fmt.Scanf("%s %d", &SKs[i].S, &SKs[i].K)
	}
	h := 0
	w := 0
	for i := N - 1; i >= 0; i-- {
		if SKs[i].S == "R" {
			if SKs[i].K == h {
				w = (w - 1 + W) % W
			}
		}else {
			if SKs[i].K == w {
				h = (h - 1 + H) % H
			}
		}
	}
	if (w + h) % 2 == 0 {
		fmt.Printf("white")
	}else {
		fmt.Printf("black")
	}

}
0