結果

問題 No.486 3 Straight Win(3連勝)
ユーザー CroweaCrowea
提出日時 2019-01-24 11:55:09
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 574 bytes
コンパイル時間 791 ms
コンパイル使用メモリ 65,184 KB
実行使用メモリ 26,616 KB
最終ジャッジ日時 2023-10-14 09:37:06
合計ジャッジ時間 4,504 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 93 ms
24,448 KB
testcase_04 AC 93 ms
24,440 KB
testcase_05 AC 93 ms
26,340 KB
testcase_06 WA -
testcase_07 AC 93 ms
24,368 KB
testcase_08 WA -
testcase_09 AC 94 ms
24,396 KB
testcase_10 AC 94 ms
24,328 KB
testcase_11 AC 94 ms
26,232 KB
testcase_12 AC 93 ms
24,336 KB
testcase_13 WA -
testcase_14 AC 89 ms
24,320 KB
testcase_15 WA -
testcase_16 AC 92 ms
22,248 KB
testcase_17 AC 90 ms
26,048 KB
testcase_18 AC 89 ms
26,392 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 90 ms
26,068 KB
testcase_22 AC 94 ms
24,368 KB
testcase_23 AC 94 ms
24,468 KB
testcase_24 AC 89 ms
22,156 KB
testcase_25 AC 89 ms
24,104 KB
testcase_26 AC 90 ms
24,368 KB
testcase_27 AC 90 ms
24,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Text.RegularExpressions;

class Program
{
    const string WIN = @"OOOO*";
    const string LOSE = @"XXXX*";
    const string E = "East";
    const string W = "West";
    const string N = "NA";
    static void Main(string[] args)
    {
        var line = Console.ReadLine();
        var idxEast = Regex.Match(line, WIN).Index;
        var idxWest = Regex.Match(line, LOSE).Index;

            if (idxEast < idxWest) Console.WriteLine(E);
            else if (idxEast > idxWest) Console.WriteLine(W);
            else Console.WriteLine(N);
    }
}
0