結果

問題 No.341 沈黙の期間
ユーザー holegumaholeguma
提出日時 2016-02-18 22:24:21
言語 Java19
(openjdk 21)
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 834 bytes
コンパイル時間 2,359 ms
コンパイル使用メモリ 76,220 KB
実行使用メモリ 53,520 KB
最終ジャッジ日時 2023-10-23 18:15:43
合計ジャッジ時間 3,930 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
53,512 KB
testcase_01 AC 56 ms
52,480 KB
testcase_02 AC 59 ms
52,488 KB
testcase_03 AC 59 ms
53,504 KB
testcase_04 AC 60 ms
53,508 KB
testcase_05 AC 58 ms
53,516 KB
testcase_06 AC 59 ms
53,508 KB
testcase_07 AC 59 ms
53,504 KB
testcase_08 AC 59 ms
53,508 KB
testcase_09 AC 57 ms
53,508 KB
testcase_10 AC 58 ms
53,520 KB
testcase_11 AC 56 ms
53,504 KB
testcase_12 AC 59 ms
52,404 KB
testcase_13 AC 57 ms
52,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.math.BigInteger;

public class Main{

	static PrintWriter out;
	static BufferedReader ir;

	static void solve() throws IOException{
		char[] s=ir.readLine().toCharArray();
		int cnt=0,ma=0;
		for(int i=0;i<s.length;i++){
			if(s[i]=='…') cnt++;
			else{
				ma=Math.max(ma,cnt);
				cnt=0;
			}
		}
		ma=Math.max(cnt,ma);
		out.println(ma);
	}

	public static void main(String[] args) throws Exception{
		ir=new BufferedReader(new InputStreamReader(System.in,"UTF-8"));
		out=new PrintWriter(System.out);
		solve();
		out.flush();
	}
}
0