結果
問題 | No.486 3 Straight Win(3連勝) |
ユーザー |
|
提出日時 | 2017-02-27 13:19:17 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 45 ms / 2,000 ms |
コード長 | 839 bytes |
コンパイル時間 | 824 ms |
コンパイル使用メモリ | 108,280 KB |
実行使用メモリ | 26,288 KB |
最終ジャッジ日時 | 2024-06-26 04:11:14 |
合計ジャッジ時間 | 2,503 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;using System.Linq;using System.Collections.Generic;class Program{static void Main(string[] args){string s = Console.ReadLine();int eFlg = 0;int wFlg = 0;string ans = "NA";if (s.Contains("OOO")){eFlg = 1;}if (s.Contains("XXX")){wFlg = 1;}if (eFlg == 1 && wFlg == 1){if (s.IndexOf("OOO") < s.IndexOf("XXX")){ans = "East";}else{ans = "West";}}else if (eFlg == 1){ans = "East";}else if (wFlg == 1){ans = "West";}Console.WriteLine(ans);Console.Read();}}