結果

問題 No.351 市松スライドパズル
ユーザー ebicochinealebicochineal
提出日時 2016-03-12 06:35:43
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 760 ms / 2,000 ms
コード長 622 bytes
コンパイル時間 3,261 ms
コンパイル使用メモリ 108,360 KB
実行使用メモリ 62,684 KB
最終ジャッジ日時 2023-10-25 07:30:54
合計ジャッジ時間 9,856 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 661 ms
62,432 KB
testcase_01 AC 26 ms
24,156 KB
testcase_02 AC 26 ms
24,156 KB
testcase_03 AC 25 ms
24,156 KB
testcase_04 AC 26 ms
24,156 KB
testcase_05 AC 26 ms
24,156 KB
testcase_06 AC 26 ms
24,156 KB
testcase_07 AC 25 ms
24,156 KB
testcase_08 AC 26 ms
24,156 KB
testcase_09 AC 26 ms
24,156 KB
testcase_10 AC 25 ms
24,156 KB
testcase_11 AC 26 ms
24,156 KB
testcase_12 AC 26 ms
24,156 KB
testcase_13 AC 746 ms
62,200 KB
testcase_14 AC 747 ms
62,320 KB
testcase_15 AC 760 ms
62,512 KB
testcase_16 AC 760 ms
62,516 KB
testcase_17 AC 751 ms
62,516 KB
testcase_18 AC 749 ms
62,516 KB
testcase_19 AC 755 ms
62,540 KB
testcase_20 AC 754 ms
62,684 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
class P{
	public static void Main(){
		string[] SHW = Console.ReadLine().Split();
		int H = int.Parse(SHW[0])-1;
		int W = int.Parse(SHW[1])-1;
		int N = int.Parse(Console.ReadLine());
		string[] S = new string[N];
		int[] K = new int[N];
		int x = 0;
		int y = 0;
		int n = 0;
		for(int i=0; i<N; ++i){
			string[] s = Console.ReadLine().Split();
			S[i] = s[0];
			K[i] = int.Parse(s[1]);
		}
		for(int i=N-1; i>-1; --i){
			if(S[i]=="C" && K[i] == x){
				y = y-1<0 ? H : y-1;
			}else if(S[i]=="R" && K[i] == y){
				x = x-1<0 ? W : x-1;
			}
		}
		Console.WriteLine((y+x)%2==0 ? "white" : "black");
	}
}
0