結果

問題 No.351 市松スライドパズル
ユーザー abL8ZLsTbFabL8ZLsTbF
提出日時 2016-04-08 21:03:13
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 1,308 bytes
コンパイル時間 873 ms
コンパイル使用メモリ 114,252 KB
実行使用メモリ 171,648 KB
最終ジャッジ日時 2024-04-14 23:28:54
合計ジャッジ時間 7,301 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 600 ms
35,148 KB
testcase_01 AC 25 ms
23,912 KB
testcase_02 AC 26 ms
21,812 KB
testcase_03 AC 25 ms
23,912 KB
testcase_04 AC 26 ms
23,844 KB
testcase_05 AC 26 ms
26,080 KB
testcase_06 AC 26 ms
23,908 KB
testcase_07 AC 25 ms
23,912 KB
testcase_08 AC 27 ms
24,040 KB
testcase_09 AC 25 ms
23,912 KB
testcase_10 AC 25 ms
23,524 KB
testcase_11 AC 26 ms
23,788 KB
testcase_12 AC 26 ms
23,848 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());
        for (int i = 0; i < n; i++) {
            string[] move = Console.ReadLine().Split();
            int line = int.Parse(move[1]);
            if (move[0] == "C") {
                bool[] temp = new bool[size[0]];
                for (int j = 0; j < size[0]; j++) {
                    temp[j] = isWhite[j, line];
                }
                for (int j = 0; j < size[0]; j++) {
                    isWhite[(j+1)%size[0], line] = temp[j];
                }
            } else {
                bool[] temp = new bool[size[1]];
                for (int j = 0; j < size[1]; j++) {
                    temp[j] = isWhite[line, j];
                }
                for (int j = 0; j < size[1]; j++) {
                    isWhite[line, (j+1)%size[1]] = temp[j];
                }
            }
        }
        Console.WriteLine(isWhite[0, 0] ? "white" : "black");
    }
}
0