結果

問題 No.341 沈黙の期間
ユーザー TakaTaka
提出日時 2016-11-01 20:01:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 5,000 ms
コード長 518 bytes
コンパイル時間 3,088 ms
コンパイル使用メモリ 72,680 KB
実行使用メモリ 57,620 KB
最終ジャッジ日時 2023-08-16 12:27:36
合計ジャッジ時間 5,653 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
55,972 KB
testcase_01 AC 115 ms
55,476 KB
testcase_02 AC 115 ms
55,380 KB
testcase_03 AC 115 ms
55,632 KB
testcase_04 AC 116 ms
55,836 KB
testcase_05 AC 115 ms
55,900 KB
testcase_06 AC 118 ms
55,728 KB
testcase_07 AC 117 ms
55,712 KB
testcase_08 AC 117 ms
56,276 KB
testcase_09 AC 118 ms
55,588 KB
testcase_10 AC 117 ms
56,028 KB
testcase_11 AC 117 ms
56,148 KB
testcase_12 AC 120 ms
57,620 KB
testcase_13 AC 121 ms
56,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class a{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
		String a=sc.next();
		
		int tmp[]=new int[50];
		for(int j=0; j<50; j++){
			tmp[j]=0;
		}
		
		int num=0, cnt=0;
		
		for(int i=0; i<a.length(); i++){
			if(a.charAt(i)!='…' && tmp[num]>0){
				num++;
			}
			if(a.charAt(i)=='…'){
				tmp[num]++;
			}
		}
		int max=0;
		for(int j=0; j<50; j++){
			if(tmp[j]>max){
				max=tmp[j];
			}
		}
		
		System.out.println(max);
    }
}
0