結果
| 問題 |
No.351 市松スライドパズル
|
| コンテスト | |
| ユーザー |
kuuso1
|
| 提出日時 | 2017-07-01 15:35:17 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,441 bytes |
| コンパイル時間 | 2,230 ms |
| コンパイル使用メモリ | 108,928 KB |
| 実行使用メモリ | 132,068 KB |
| 最終ジャッジ日時 | 2024-10-05 04:25:35 |
| 合計ジャッジ時間 | 13,035 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 17 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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, c = 0;
for(int i=N-1;i>=0;i--){
switch (Q[i][0][0]){
case 'R':
int tr = int.Parse(Q[i][1]);
if(r == tr){
c--;
if(c < 0) c += W;
}
break;
case 'C':
int tc = int.Parse(Q[i][1]);
if(c == tc){
r--;
if(r < 0) r += H;
}
break;
}
//Console.WriteLine("r:{0} c:{1}",r,c);
}
Console.WriteLine((r+c) % 2 == 0 ? "black" : "white");
}
int H,W;
int N;
String[][] Q;
public Sol(){
var d = ria();
H = d[0]; W = d[1];
N = ri();
Q = new String[N][];
for(int i=0;i<N;i++) Q[i] = rsa();
}
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));}
}
kuuso1