結果

問題 No.341 沈黙の期間
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-11 23:30:50
言語 Java19
(openjdk 21)
結果
AC  
実行時間 120 ms / 5,000 ms
コード長 386 bytes
コンパイル時間 1,908 ms
コンパイル使用メモリ 71,212 KB
実行使用メモリ 56,388 KB
最終ジャッジ日時 2023-08-13 16:42:51
合計ジャッジ時間 4,417 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,940 KB
testcase_01 AC 118 ms
55,364 KB
testcase_02 AC 118 ms
55,740 KB
testcase_03 AC 117 ms
55,896 KB
testcase_04 AC 118 ms
56,388 KB
testcase_05 AC 118 ms
55,884 KB
testcase_06 AC 118 ms
55,180 KB
testcase_07 AC 118 ms
55,916 KB
testcase_08 AC 119 ms
55,700 KB
testcase_09 AC 117 ms
55,480 KB
testcase_10 AC 119 ms
55,644 KB
testcase_11 AC 119 ms
55,588 KB
testcase_12 AC 118 ms
55,948 KB
testcase_13 AC 119 ms
55,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		String s = sc.next();
		int leng = 0;
		int max = -1;
		for (int i=0; i<s.length(); i++) {
			char c = s.charAt(i);
			if (c=='…') {
				leng++;
				max = Math.max(max,leng);
			}
			else {
				leng = 0;
			}
		}
		System.out.println(max==-1?0:max);
	}
}
0