結果

問題 No.351 市松スライドパズル
ユーザー abL8ZLsTbFabL8ZLsTbF
提出日時 2016-04-08 21:05:30
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 1,298 bytes
コンパイル時間 812 ms
コンパイル使用メモリ 111,920 KB
実行使用メモリ 127,660 KB
最終ジャッジ日時 2024-04-14 23:29:13
合計ジャッジ時間 6,376 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 523 ms
29,980 KB
testcase_01 AC 25 ms
23,780 KB
testcase_02 AC 23 ms
23,788 KB
testcase_03 AC 23 ms
26,024 KB
testcase_04 AC 23 ms
24,040 KB
testcase_05 AC 22 ms
24,044 KB
testcase_06 AC 23 ms
23,972 KB
testcase_07 AC 23 ms
24,368 KB
testcase_08 AC 23 ms
26,020 KB
testcase_09 AC 22 ms
23,784 KB
testcase_10 AC 21 ms
23,908 KB
testcase_11 AC 22 ms
23,788 KB
testcase_12 AC 21 ms
24,056 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Program {
    public static void Main() {
        int[] size = Array.ConvertAll(Console.ReadLine().Split(), value => int.Parse(value));
        bool[,] isWhite = new bool[size[0], size[1]];
        for (int i = 0; i < size[0]; i++) {
            for (int j = 0; j < size[1]; j++) {
                isWhite[i, j] = ((i+j)&1) == 0;
            }
        }
        int n = int.Parse(Console.ReadLine());
        bool[] tempC = new bool[size[0]];
        bool[] tempR = new bool[size[1]];
        for (int i = 0; i < n; i++) {
            string[] move = Console.ReadLine().Split();
            int line = int.Parse(move[1]);
            if (move[0] == "C") {
                for (int j = 0; j < size[0]; j++) {
                    tempC[j] = isWhite[j, line];
                }
                for (int j = 0; j < size[0]; j++) {
                    isWhite[(j+1)%size[0], line] = tempC[j];
                }
            } else {
                for (int j = 0; j < size[1]; j++) {
                    tempR[j] = isWhite[line, j];
                }
                for (int j = 0; j < size[1]; j++) {
                    isWhite[line, (j+1)%size[1]] = tempR[j];
                }
            }
        }
        Console.WriteLine(isWhite[0, 0] ? "white" : "black");
    }
}
0