結果

問題 No.351 市松スライドパズル
ユーザー kuuso1kuuso1
提出日時 2016-03-11 23:03:35
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 489 ms / 2,000 ms
コード長 1,349 bytes
コンパイル時間 1,851 ms
コンパイル使用メモリ 111,520 KB
実行使用メモリ 74,300 KB
最終ジャッジ日時 2023-10-25 07:12:38
合計ジャッジ時間 7,319 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 427 ms
67,160 KB
testcase_01 AC 24 ms
24,160 KB
testcase_02 AC 25 ms
24,160 KB
testcase_03 AC 25 ms
24,160 KB
testcase_04 AC 26 ms
24,160 KB
testcase_05 AC 25 ms
24,160 KB
testcase_06 AC 25 ms
24,160 KB
testcase_07 AC 26 ms
24,160 KB
testcase_08 AC 25 ms
24,160 KB
testcase_09 AC 26 ms
24,160 KB
testcase_10 AC 26 ms
24,160 KB
testcase_11 AC 24 ms
24,160 KB
testcase_12 AC 25 ms
24,160 KB
testcase_13 AC 488 ms
73,192 KB
testcase_14 AC 488 ms
73,548 KB
testcase_15 AC 489 ms
74,272 KB
testcase_16 AC 488 ms
74,288 KB
testcase_17 AC 484 ms
74,288 KB
testcase_18 AC 480 ms
74,288 KB
testcase_19 AC 489 ms
74,300 KB
testcase_20 AC 489 ms
74,300 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		int r=0;
		int c=0;
		for(int i=N-1;i>=0;i--){
			if(A[i][0]=='R'){
				int r0=int.Parse(A[i].Substring(2));
				if(r==r0){
					c=(c-1+W)%W;
				}
			}
			if(A[i][0]=='C'){
				int c0=int.Parse(A[i].Substring(2));
				if(c==c0){
					r=(r-1+H)%H;
				}
			}
//Console.WriteLine(r+" "+c);
		}
		Console.WriteLine((r+c)%2==0?"white":"black");
	}
	int H,W;
	int N;
	String[] A;
	public Sol(){
		var d=ria();
		H=d[0];W=d[1];
		N=ri();
		A=new String[N];
		for(int i=0;i<N;i++){
			A[i]=rs();
		}
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}
0