結果

問題 No.341 沈黙の期間
ユーザー jp_stejp_ste
提出日時 2016-02-12 23:07:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 5,000 ms
コード長 462 bytes
コンパイル時間 2,740 ms
コンパイル使用メモリ 74,120 KB
実行使用メモリ 57,652 KB
最終ジャッジ日時 2023-10-22 03:25:18
合計ジャッジ時間 4,216 ms
ジャッジサーバーID
(参考情報)
judge9 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
56,920 KB
testcase_01 AC 99 ms
55,780 KB
testcase_02 AC 111 ms
57,268 KB
testcase_03 AC 118 ms
57,456 KB
testcase_04 AC 111 ms
57,412 KB
testcase_05 AC 116 ms
57,360 KB
testcase_06 AC 107 ms
57,272 KB
testcase_07 AC 113 ms
57,552 KB
testcase_08 AC 98 ms
56,300 KB
testcase_09 AC 114 ms
57,652 KB
testcase_10 AC 111 ms
57,424 KB
testcase_11 AC 104 ms
56,820 KB
testcase_12 AC 121 ms
57,472 KB
testcase_13 AC 114 ms
57,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String S = scan.nextLine();
		
		int ans = 0;
		for(int i=0; i<S.length(); i++) {
			if(S.charAt(i) == '…') {
				int count = 0;
				for(int j=i; j<S.length(); j++) {
					if(!(S.charAt(j) == '…')) {
						i=j+1;
						break;
					}
					count++;
				}
				ans = Math.max(ans, count);
			}
		}
		System.out.println(ans);
	}
}
0