結果

問題 No.341 沈黙の期間
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-11 23:30:14
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 2,249 ms
コンパイル使用メモリ 74,516 KB
実行使用メモリ 54,172 KB
最終ジャッジ日時 2024-05-01 09:28:14
合計ジャッジ時間 4,294 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
52,652 KB
testcase_01 AC 121 ms
54,172 KB
testcase_02 AC 110 ms
52,992 KB
testcase_03 AC 117 ms
41,420 KB
testcase_04 AC 120 ms
41,456 KB
testcase_05 AC 119 ms
41,424 KB
testcase_06 AC 124 ms
41,332 KB
testcase_07 AC 122 ms
41,296 KB
testcase_08 AC 120 ms
40,972 KB
testcase_09 AC 123 ms
41,228 KB
testcase_10 AC 122 ms
41,668 KB
testcase_11 WA -
testcase_12 AC 123 ms
41,392 KB
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

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?-1:max);
	}
}
0