結果

問題 No.486 3 Straight Win(3連勝)
ユーザー YoiTakaYoiTaka
提出日時 2017-03-03 22:03:19
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 879 bytes
コンパイル時間 2,052 ms
コンパイル使用メモリ 104,412 KB
実行使用メモリ 22,588 KB
最終ジャッジ日時 2023-09-08 10:57:16
合計ジャッジ時間 4,765 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
22,576 KB
testcase_01 AC 50 ms
20,628 KB
testcase_02 AC 49 ms
20,444 KB
testcase_03 AC 49 ms
20,444 KB
testcase_04 AC 49 ms
20,616 KB
testcase_05 AC 49 ms
20,532 KB
testcase_06 AC 49 ms
18,488 KB
testcase_07 AC 50 ms
20,452 KB
testcase_08 AC 50 ms
22,524 KB
testcase_09 AC 51 ms
20,460 KB
testcase_10 AC 50 ms
20,452 KB
testcase_11 AC 50 ms
20,580 KB
testcase_12 AC 50 ms
22,504 KB
testcase_13 AC 49 ms
20,452 KB
testcase_14 AC 49 ms
20,392 KB
testcase_15 AC 49 ms
20,392 KB
testcase_16 AC 49 ms
20,468 KB
testcase_17 AC 50 ms
20,636 KB
testcase_18 AC 50 ms
20,540 KB
testcase_19 AC 49 ms
20,524 KB
testcase_20 AC 51 ms
22,576 KB
testcase_21 AC 50 ms
20,552 KB
testcase_22 AC 50 ms
20,496 KB
testcase_23 AC 50 ms
20,532 KB
testcase_24 AC 49 ms
22,588 KB
testcase_25 AC 50 ms
22,568 KB
testcase_26 AC 49 ms
20,508 KB
testcase_27 AC 49 ms
20,568 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;
using System.Text;

class Program
{
    static void Main(string[] args)
    {
        char[] A = Console.ReadLine().ToCharArray();

        int west = 0;
        int east = 0;
        int count = 0;
        for (int i = 0; i < A.Length; i++)
        {
            if (A[i] == 'O')
            {
                east++;

                if (east == 3)
                {
                    System.Console.WriteLine("East");
                    return;
                }

                west = 0;
            }
            else
            {
                west++;
                if (west == 3)
                {
                    System.Console.WriteLine("West");
                    return;
                }
                east = 0;
            }
        }

        System.Console.WriteLine("NA");
    }
}
0