結果
問題 | No.436 ccw |
ユーザー | 14番 |
提出日時 | 2016-10-28 22:44:29 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 23 ms / 2,000 ms |
コード長 | 950 bytes |
コンパイル時間 | 716 ms |
コンパイル使用メモリ | 107,760 KB |
実行使用メモリ | 17,792 KB |
最終ジャッジ日時 | 2024-11-24 05:53:00 |
合計ジャッジ時間 | 2,025 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
コンパイルメッセージ
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; public class Program { public void Proc() { Reader.IsDebug = false; string inpt = Reader.ReadLine(); int ans1 = inpt.LastIndexOf('c'); int ans2 = inpt.Length - inpt.IndexOf('w'); Console.WriteLine(Math.Min(ans1, ans2)); } public class Reader { public static bool IsDebug = true; private static System.IO.StringReader SReader; private static string InitText = @" ccccccccwww "; public static string ReadLine() { if(IsDebug) { if(SReader == null) { SReader = new System.IO.StringReader(InitText.Trim()); } return SReader.ReadLine(); } else { return Console.ReadLine(); } } } public static void Main(string[] args) { Program prg = new Program(); prg.Proc(); } }