結果

問題 No.341 沈黙の期間
ユーザー h_tyokinuhatah_tyokinuhata
提出日時 2016-02-14 21:47:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 5,000 ms
コード長 448 bytes
コンパイル時間 3,818 ms
コンパイル使用メモリ 73,764 KB
実行使用メモリ 57,524 KB
最終ジャッジ日時 2023-10-22 05:22:30
合計ジャッジ時間 5,130 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
57,524 KB
testcase_01 AC 125 ms
57,440 KB
testcase_02 AC 130 ms
57,384 KB
testcase_03 AC 127 ms
57,380 KB
testcase_04 AC 127 ms
57,368 KB
testcase_05 AC 127 ms
57,360 KB
testcase_06 AC 129 ms
57,492 KB
testcase_07 AC 126 ms
57,232 KB
testcase_08 AC 126 ms
57,232 KB
testcase_09 AC 127 ms
57,468 KB
testcase_10 AC 127 ms
55,516 KB
testcase_11 AC 127 ms
57,032 KB
testcase_12 AC 128 ms
57,492 KB
testcase_13 AC 128 ms
57,180 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		
		char[] charS = S.toCharArray();
		
		int cnt = 0, max = 0;
		
		for(int i = 0; i < S.length(); i++) {
			if(charS[i] == '…') {
				cnt++;
			} else {
				if(cnt > max) {
					max = cnt;
				}
				
				cnt = 0;
			}
		}
		
		if(cnt > max) {
			max = cnt;
		}
		
		System.out.println(max);
	}
}
0