結果

問題 No.341 沈黙の期間
ユーザー nanophoto12nanophoto12
提出日時 2016-02-14 00:20:01
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 29 ms / 5,000 ms
コード長 615 bytes
コンパイル時間 783 ms
コンパイル使用メモリ 107,944 KB
実行使用メモリ 24,876 KB
最終ジャッジ日時 2023-10-22 05:03:47
合計ジャッジ時間 1,866 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
24,876 KB
testcase_01 AC 27 ms
24,876 KB
testcase_02 AC 27 ms
24,876 KB
testcase_03 AC 28 ms
24,876 KB
testcase_04 AC 27 ms
24,876 KB
testcase_05 AC 27 ms
24,876 KB
testcase_06 AC 27 ms
24,876 KB
testcase_07 AC 29 ms
24,876 KB
testcase_08 AC 27 ms
24,876 KB
testcase_09 AC 27 ms
24,876 KB
testcase_10 AC 29 ms
24,876 KB
testcase_11 AC 27 ms
24,876 KB
testcase_12 AC 27 ms
24,876 KB
testcase_13 AC 28 ms
24,876 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.Collections.Generic;

namespace Yukicoder
{
	public static class Program
	{
		public static void Main (string[] args)
		{
			string line = Console.ReadLine ();
			int count = 0;
			int front = 0;
			int maxValue = 0;
			while (front < line.Length) {
				var index = line.IndexOf ("…", front);
				if (index < 0) {
					break;
				}
				if (index != front) {
					front = index;
					maxValue = Math.Max (count, maxValue);
					count = 0;
				} else {
					front++;
					count++;
				}
			}
			maxValue = Math.Max (count, maxValue);
			Console.WriteLine (maxValue.ToString ());
		}
	}
}
0