結果

問題 No.341 沈黙の期間
ユーザー spaciaspacia
提出日時 2016-06-03 09:56:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 423 bytes
コンパイル時間 1,921 ms
コンパイル使用メモリ 75,156 KB
実行使用メモリ 41,752 KB
最終ジャッジ日時 2024-04-16 23:26:32
合計ジャッジ時間 4,275 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
41,452 KB
testcase_01 AC 121 ms
41,164 KB
testcase_02 AC 125 ms
41,248 KB
testcase_03 AC 121 ms
41,320 KB
testcase_04 AC 122 ms
41,020 KB
testcase_05 AC 107 ms
41,496 KB
testcase_06 AC 124 ms
41,460 KB
testcase_07 AC 118 ms
41,456 KB
testcase_08 AC 108 ms
41,156 KB
testcase_09 AC 116 ms
41,396 KB
testcase_10 AC 113 ms
41,456 KB
testcase_11 AC 119 ms
41,568 KB
testcase_12 AC 120 ms
41,752 KB
testcase_13 AC 119 ms
41,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);

		System.out.println(solve(sc.next()));

		sc.close();
	}

	public static int solve (String s) {
		int ret = 0;
		for (int i = 0; i < s.length();) {
			int cnt = 0;
			while (i < s.length() && s.charAt(i++) == '…')
				cnt++;
			ret = Math.max(ret, cnt);
			cnt = 0;
		}
		return ret;
	}

}
0