結果
問題 |
No.436 ccw
|
ユーザー |
|
提出日時 | 2016-10-28 22:35:30 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,114 bytes |
コンパイル時間 | 753 ms |
コンパイル使用メモリ | 112,828 KB |
実行使用メモリ | 25,376 KB |
最終ジャッジ日時 | 2024-11-24 05:48:19 |
合計ジャッジ時間 | 2,133 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 WA * 2 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; using System.Collections; using System.Linq; namespace contest { class contest { static void Main(string[] args) { //int n = int.Parse(Console.ReadLine()); //var input = Console.ReadLine().Split().Select(int.Parse).ToArray(); //var n = int.Parse(Console.ReadLine()); //var input = Console.ReadLine().Split().Select(int.Parse).ToArray(); string s = Console.ReadLine(); var list = new List<int>(); int index = 0; while(true) { index = s.IndexOf("ccw", index+1); if (index >= 0) list.Add(index); else break; } int min = 10000000; for(int i =0; i<list.Count(); i++) { //int tmp = list[i] + s.Length - (list[i] + 2); min = Math.Min(list[i]+1 , s.Length - (list[i] + 2)); } Console.WriteLine(min); // Console.Read(); } } }