結果

問題 No.486 3 Straight Win(3連勝)
ユーザー curryudon08curryudon08
提出日時 2020-06-15 18:39:03
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 52 ms / 2,000 ms
コード長 734 bytes
コンパイル時間 2,065 ms
コンパイル使用メモリ 104,272 KB
実行使用メモリ 23,516 KB
最終ジャッジ日時 2023-09-16 10:29:55
合計ジャッジ時間 5,243 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
23,428 KB
testcase_01 AC 51 ms
19,328 KB
testcase_02 AC 52 ms
21,472 KB
testcase_03 AC 51 ms
21,436 KB
testcase_04 AC 51 ms
21,476 KB
testcase_05 AC 50 ms
21,436 KB
testcase_06 AC 50 ms
19,376 KB
testcase_07 AC 49 ms
23,384 KB
testcase_08 AC 51 ms
23,424 KB
testcase_09 AC 50 ms
21,460 KB
testcase_10 AC 52 ms
21,408 KB
testcase_11 AC 51 ms
21,408 KB
testcase_12 AC 51 ms
21,388 KB
testcase_13 AC 51 ms
21,464 KB
testcase_14 AC 52 ms
23,392 KB
testcase_15 AC 51 ms
23,364 KB
testcase_16 AC 51 ms
21,324 KB
testcase_17 AC 51 ms
23,384 KB
testcase_18 AC 51 ms
23,516 KB
testcase_19 AC 51 ms
21,552 KB
testcase_20 AC 50 ms
21,328 KB
testcase_21 AC 50 ms
21,352 KB
testcase_22 AC 51 ms
23,456 KB
testcase_23 AC 52 ms
23,392 KB
testcase_24 AC 51 ms
23,512 KB
testcase_25 AC 51 ms
23,428 KB
testcase_26 AC 51 ms
21,476 KB
testcase_27 AC 51 ms
21,388 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.Linq;

namespace _0486
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine().ToCharArray().ToArray();

            var e = 0;
            var w = 0;
            for(var i = 0; i < s.Length; i++){
                if(s[i] == 'O'){
                    e += 1;
                    w = 0;
                }else{
                    w += 1;
                    e = 0;
                }

                if(e == 3){
                    break;
                }else if(w == 3){
                    break;
                }
            }

            var o = e == 3 ? "East" : (w == 3 ? "West" : "NA");
            Console.WriteLine(o);
        }
    }
}
0