結果

問題 No.351 市松スライドパズル
ユーザー ebicochinealebicochineal
提出日時 2016-03-12 06:30:38
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 649 bytes
コンパイル時間 2,010 ms
コンパイル使用メモリ 108,516 KB
実行使用メモリ 62,748 KB
最終ジャッジ日時 2023-10-25 06:39:37
合計ジャッジ時間 29,193 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 24 ms
24,108 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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>0; --i){
			Console.WriteLine(S[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