結果
問題 | No.418 ミンミンゼミ |
ユーザー |
|
提出日時 | 2016-09-20 16:15:43 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 31 ms / 1,000 ms |
コード長 | 1,766 bytes |
コンパイル時間 | 1,011 ms |
コンパイル使用メモリ | 112,372 KB |
実行使用メモリ | 27,096 KB |
最終ジャッジ日時 | 2024-07-16 01:25:09 |
合計ジャッジ時間 | 2,639 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 |
コンパイルメッセージ
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.IO;using System.Linq;public class YukiCoder{public static void Solve(){string S = MyConsole.String();S = S.Replace( "-", "");string[] strs = S.Split( new []{"m"}, StringSplitOptions.RemoveEmptyEntries );int ans = strs.Count( s => s.Equals( "in" ) );MyConsole.wLine( ans.ToString() );}public static void Main(){MyConsole.Read(); Solve(); MyConsole.Finish();}}public static class MyConsole{private static List<string> ReadedLine = new List<string>();private static char[] buf = new char[1024];private static int i;public static void Read(){TextReader sr = Console.In;int Len = sr.Read( buf, 0, 1024 );var Line = string.Empty;for (int i = 0 ; i < Len ; i++){if (buf[i] >= 33 && buf[i] <= 126){Line += buf[i];}else if (Line.Length > 0){ReadedLine.Add( Line );Line = string.Empty;}}if (Line.Length > 0) ReadedLine.Add( Line );Console.SetOut( new StreamWriter( Console.OpenStandardOutput() ) { AutoFlush = false } );}public static string String() { return ReadedLine[i++]; }public static int Int() { return int.Parse( ReadedLine[i++] ); }public static long Long() { return long.Parse( ReadedLine[i++] ); }public static double Double() { return double.Parse( ReadedLine[i++] ); }public static void wLine( string output = null ){Console.WriteLine( output );}public static void Finish(){Console.Out.Flush();}}