結果

問題 No.341 沈黙の期間
ユーザー mitsuomitsuo
提出日時 2016-05-04 12:34:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 135 ms / 5,000 ms
コード長 525 bytes
コンパイル時間 2,320 ms
コンパイル使用メモリ 75,036 KB
実行使用メモリ 54,392 KB
最終ジャッジ日時 2024-04-15 11:15:27
合計ジャッジ時間 5,084 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
54,012 KB
testcase_01 AC 130 ms
54,184 KB
testcase_02 AC 129 ms
54,088 KB
testcase_03 AC 130 ms
54,096 KB
testcase_04 AC 135 ms
54,268 KB
testcase_05 AC 132 ms
54,256 KB
testcase_06 AC 129 ms
54,204 KB
testcase_07 AC 131 ms
53,976 KB
testcase_08 AC 131 ms
54,268 KB
testcase_09 AC 129 ms
53,860 KB
testcase_10 AC 131 ms
54,392 KB
testcase_11 AC 131 ms
54,252 KB
testcase_12 AC 130 ms
54,000 KB
testcase_13 AC 130 ms
54,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String input;
		if (args.length == 0) {
			input = sc.nextLine();
		} else {
			input = args[0];
		}

		System.out.println(solve(input));

		sc.close();
	}

	public static int solve(String in) {
		int ans = 0;
		int c = 0;
		for(int i = 0; i < in.length(); i++){
			if(in.substring(i, i + 1).equals("…")){
				c++;
				ans = Math.max(c, ans);
			}else{
				c = 0;
			}
		}
		return ans;
	}
}
0