結果

問題 No.341 沈黙の期間
ユーザー めうめう🎒めうめう🎒
提出日時 2016-05-07 20:59:51
言語 Java
(openjdk 23)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 582 bytes
コンパイル時間 2,289 ms
コンパイル使用メモリ 74,448 KB
実行使用メモリ 54,032 KB
最終ジャッジ日時 2024-10-05 10:26:17
合計ジャッジ時間 4,192 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

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