結果

問題 No.486 3 Straight Win(3連勝)
ユーザー kmtrc130kmtrc130
提出日時 2019-03-18 16:03:43
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 630 bytes
コンパイル時間 2,120 ms
コンパイル使用メモリ 101,332 KB
実行使用メモリ 23,444 KB
最終ジャッジ日時 2023-09-25 13:33:09
合計ジャッジ時間 6,026 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
21,000 KB
testcase_01 AC 69 ms
23,100 KB
testcase_02 AC 70 ms
23,160 KB
testcase_03 AC 69 ms
23,144 KB
testcase_04 AC 68 ms
21,096 KB
testcase_05 AC 68 ms
21,180 KB
testcase_06 AC 68 ms
21,104 KB
testcase_07 AC 68 ms
23,164 KB
testcase_08 AC 69 ms
23,128 KB
testcase_09 AC 68 ms
21,236 KB
testcase_10 AC 68 ms
21,224 KB
testcase_11 AC 68 ms
19,184 KB
testcase_12 AC 68 ms
23,148 KB
testcase_13 AC 68 ms
21,176 KB
testcase_14 AC 74 ms
21,464 KB
testcase_15 AC 69 ms
23,336 KB
testcase_16 AC 68 ms
23,188 KB
testcase_17 AC 68 ms
23,200 KB
testcase_18 AC 74 ms
23,444 KB
testcase_19 AC 68 ms
21,112 KB
testcase_20 AC 68 ms
23,148 KB
testcase_21 AC 68 ms
21,168 KB
testcase_22 AC 68 ms
23,216 KB
testcase_23 AC 67 ms
23,176 KB
testcase_24 AC 69 ms
21,200 KB
testcase_25 AC 75 ms
21,476 KB
testcase_26 AC 74 ms
23,356 KB
testcase_27 AC 73 ms
21,432 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Collections.Generic;
using System.Linq;

class Program
{
    public void Solve()
    {
        string S = Console.ReadLine();

        int east = S.IndexOf("OOO");
        int west = S.IndexOf("XXX");

        if (0 <= west && (west < east || east < 0))
        {
            Console.WriteLine("West");
        }
        else if (0 <= east && (east < west || west < 0))
        {
            Console.WriteLine("East");
        }
        else
        {
            Console.WriteLine("NA");
        }
    }

    static void Main()
    {
        var solver = new Program();
        solver.Solve();
    }
}
0