結果

問題 No.486 3 Straight Win(3連勝)
ユーザー CroweaCrowea
提出日時 2019-01-24 12:40:49
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 716 bytes
コンパイル時間 988 ms
コンパイル使用メモリ 63,220 KB
実行使用メモリ 22,652 KB
最終ジャッジ日時 2023-10-14 09:37:20
合計ジャッジ時間 3,340 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
20,548 KB
testcase_01 AC 48 ms
22,508 KB
testcase_02 AC 48 ms
20,588 KB
testcase_03 AC 48 ms
20,564 KB
testcase_04 AC 48 ms
20,420 KB
testcase_05 AC 48 ms
22,572 KB
testcase_06 AC 48 ms
22,508 KB
testcase_07 AC 48 ms
22,520 KB
testcase_08 AC 46 ms
20,480 KB
testcase_09 AC 47 ms
20,616 KB
testcase_10 AC 47 ms
20,508 KB
testcase_11 AC 48 ms
22,584 KB
testcase_12 AC 48 ms
20,568 KB
testcase_13 AC 47 ms
20,600 KB
testcase_14 AC 48 ms
20,560 KB
testcase_15 AC 48 ms
20,520 KB
testcase_16 AC 48 ms
22,512 KB
testcase_17 AC 48 ms
20,648 KB
testcase_18 AC 48 ms
22,508 KB
testcase_19 AC 48 ms
20,556 KB
testcase_20 AC 47 ms
18,548 KB
testcase_21 AC 48 ms
22,652 KB
testcase_22 AC 48 ms
18,608 KB
testcase_23 AC 48 ms
20,544 KB
testcase_24 AC 47 ms
18,504 KB
testcase_25 AC 48 ms
20,616 KB
testcase_26 AC 47 ms
20,540 KB
testcase_27 AC 47 ms
20,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;

class Program
{
    const char WIN  = 'O';
    const char LOSE = 'X';
    const string E = "East";
    const string W = "West";
    const string N = "NA";
    static void Main(string[] args)
    {
        var input = Console.ReadLine().ToCharArray();

        for (int i=0; i < input.Length - 2; i++)
        {
            if (input[i] == WIN && input[i+1] == WIN && input[i+2] == WIN)
            {
                Console.WriteLine(E);
                return;
            }
            else if (input[i] == LOSE && input[i + 1] == LOSE && input[i + 2] == LOSE)
            {
                Console.WriteLine(W);
                return;
            }
        }
        Console.WriteLine(N);
    }
}
0