結果

問題 No.486 3 Straight Win(3連勝)
ユーザー abL8ZLsTbFabL8ZLsTbF
提出日時 2017-02-28 12:13:38
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 448 bytes
コンパイル時間 2,003 ms
コンパイル使用メモリ 101,868 KB
実行使用メモリ 22,668 KB
最終ジャッジ日時 2023-09-08 10:52:45
合計ジャッジ時間 4,536 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
22,552 KB
testcase_01 AC 49 ms
18,392 KB
testcase_02 AC 50 ms
22,468 KB
testcase_03 AC 49 ms
20,504 KB
testcase_04 AC 49 ms
22,560 KB
testcase_05 AC 50 ms
20,488 KB
testcase_06 AC 49 ms
20,616 KB
testcase_07 AC 50 ms
22,456 KB
testcase_08 AC 49 ms
20,504 KB
testcase_09 AC 48 ms
20,620 KB
testcase_10 AC 49 ms
20,436 KB
testcase_11 AC 49 ms
20,444 KB
testcase_12 AC 49 ms
20,408 KB
testcase_13 AC 49 ms
20,476 KB
testcase_14 AC 50 ms
22,472 KB
testcase_15 AC 50 ms
20,420 KB
testcase_16 AC 51 ms
20,612 KB
testcase_17 AC 49 ms
20,448 KB
testcase_18 AC 49 ms
22,480 KB
testcase_19 AC 49 ms
20,460 KB
testcase_20 AC 49 ms
22,416 KB
testcase_21 AC 49 ms
20,424 KB
testcase_22 AC 50 ms
22,668 KB
testcase_23 AC 49 ms
20,624 KB
testcase_24 AC 48 ms
18,340 KB
testcase_25 AC 49 ms
22,596 KB
testcase_26 AC 50 ms
22,468 KB
testcase_27 AC 49 ms
22,596 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;

public class Test
{
	public static void Main()
	{
		var S = Console.ReadLine();
		int east = 0, west = 0;
		for (int i = 0; i < S.Length; i++)
		{
			if (S[i] == 'O')
			{
				if (++east == 3)
				{
					Console.WriteLine("East");
					return;
				}
				west = 0;
			}
			else
			{
				if (++west == 3)
				{
					Console.WriteLine("West");
					return;
				}
				east = 0;
			}
		}
		Console.WriteLine("NA");
	}
}
0