結果

問題 No.341 沈黙の期間
ユーザー めうめう🎒めうめう🎒
提出日時 2016-05-07 20:59:51
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 582 bytes
コンパイル時間 2,454 ms
コンパイル使用メモリ 74,524 KB
実行使用メモリ 41,528 KB
最終ジャッジ日時 2024-04-15 13:40:27
合計ジャッジ時間 4,484 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
41,276 KB
testcase_01 AC 128 ms
41,516 KB
testcase_02 AC 124 ms
41,500 KB
testcase_03 AC 126 ms
41,172 KB
testcase_04 AC 128 ms
41,528 KB
testcase_05 AC 124 ms
41,440 KB
testcase_06 AC 126 ms
41,256 KB
testcase_07 AC 124 ms
41,220 KB
testcase_08 AC 126 ms
41,116 KB
testcase_09 AC 125 ms
41,188 KB
testcase_10 AC 129 ms
41,196 KB
testcase_11 AC 127 ms
41,128 KB
testcase_12 AC 128 ms
40,948 KB
testcase_13 AC 127 ms
41,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	private String str;

	public void setStr(String str){
		this.str = str;
	}

	public String getStr(){
		return str;
	}

	public void countNum(){
		int num = 0,ans = 0;
		for(int i = 0;i < this.str.length();i++){
			if(str.substring(i,i + 1).equals("…")) {
				num++;
			}else{
				ans = Math.max(num,ans);
				num = 0;
			}
		}
		ans = Math.max(num,ans);
		System.out.println(ans);
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Main m = new Main();
		m.setStr(sc.next());
		m.countNum();
	}
}
0