結果

問題 No.341 沈黙の期間
ユーザー boobrightboobright
提出日時 2016-03-19 09:05:08
言語 Java21
(openjdk 21)
結果
AC  
実行時間 57 ms / 5,000 ms
コード長 585 bytes
コンパイル時間 2,287 ms
コンパイル使用メモリ 74,524 KB
実行使用メモリ 54,004 KB
最終ジャッジ日時 2024-04-08 17:05:21
合計ジャッジ時間 3,716 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
53,964 KB
testcase_01 AC 53 ms
53,972 KB
testcase_02 AC 54 ms
54,004 KB
testcase_03 AC 53 ms
51,964 KB
testcase_04 AC 54 ms
53,980 KB
testcase_05 AC 54 ms
53,956 KB
testcase_06 AC 57 ms
53,992 KB
testcase_07 AC 56 ms
53,944 KB
testcase_08 AC 53 ms
53,968 KB
testcase_09 AC 56 ms
53,968 KB
testcase_10 AC 53 ms
53,948 KB
testcase_11 AC 53 ms
53,992 KB
testcase_12 AC 55 ms
53,968 KB
testcase_13 AC 55 ms
53,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String args[] ) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();
		int max = 0;
		boolean ten = false;
		int cnt = 0;
		for (int i = 0; i <= line.length(); i++) {
			if (i != line.length() && line.charAt(i) == '…') {
				ten = true;
				cnt++;
			} else {
				if (ten) {
					if (max < cnt) {
						max = cnt;
					}
					cnt = 0;
					ten = false;
				}
			}
		}
		System.out.println(max);
	}
}
0