結果

問題 No.341 沈黙の期間
ユーザー かにかに
提出日時 2016-02-12 22:24:21
言語 Java19
(openjdk 21)
結果
AC  
実行時間 136 ms / 5,000 ms
コード長 405 bytes
コンパイル時間 2,164 ms
コンパイル使用メモリ 74,276 KB
実行使用メモリ 57,540 KB
最終ジャッジ日時 2023-10-22 02:46:58
合計ジャッジ時間 4,864 ms
ジャッジサーバーID
(参考情報)
judge9 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
57,396 KB
testcase_01 AC 133 ms
57,540 KB
testcase_02 AC 133 ms
57,348 KB
testcase_03 AC 134 ms
57,396 KB
testcase_04 AC 135 ms
57,500 KB
testcase_05 AC 136 ms
57,412 KB
testcase_06 AC 133 ms
57,452 KB
testcase_07 AC 135 ms
57,092 KB
testcase_08 AC 133 ms
57,392 KB
testcase_09 AC 134 ms
57,488 KB
testcase_10 AC 134 ms
57,456 KB
testcase_11 AC 135 ms
57,364 KB
testcase_12 AC 136 ms
57,348 KB
testcase_13 AC 136 ms
57,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		int l = 0;
		int maxi = -1;
		for(int i = 0;i < s.length();i++){
				if(s.charAt(i) == '…'){
					l++;
				}else{
					if(maxi < l){
						maxi = l;
					}
					l = 0;
				}
		}
		if(maxi < l){
			maxi = l;
		}
		System.out.println(maxi);
	}
}
	
0