結果

問題 No.486 3 Straight Win(3連勝)
ユーザー CroweaCrowea
提出日時 2019-01-24 11:55:09
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 574 bytes
コンパイル時間 850 ms
コンパイル使用メモリ 102,784 KB
実行使用メモリ 22,144 KB
最終ジャッジ日時 2024-09-16 04:35:58
合計ジャッジ時間 3,397 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 WA * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

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