結果

問題 No.341 沈黙の期間
ユーザー mitsuo
提出日時 2016-05-04 12:34:25
言語 Java
(openjdk 23)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 525 bytes
コンパイル時間 2,219 ms
コンパイル使用メモリ 74,080 KB
実行使用メモリ 41,256 KB
最終ジャッジ日時 2024-10-05 06:22:07
合計ジャッジ時間 4,419 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

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