結果

問題 No.341 沈黙の期間
ユーザー mits58mits58
提出日時 2016-07-02 12:12:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 380 bytes
コンパイル時間 2,474 ms
コンパイル使用メモリ 73,876 KB
実行使用メモリ 41,320 KB
最終ジャッジ日時 2024-04-20 07:19:02
合計ジャッジ時間 4,594 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
41,208 KB
testcase_01 AC 125 ms
41,312 KB
testcase_02 AC 125 ms
41,200 KB
testcase_03 AC 124 ms
41,320 KB
testcase_04 AC 124 ms
41,096 KB
testcase_05 AC 125 ms
41,244 KB
testcase_06 AC 129 ms
41,276 KB
testcase_07 AC 128 ms
40,940 KB
testcase_08 AC 124 ms
41,224 KB
testcase_09 AC 124 ms
40,876 KB
testcase_10 AC 124 ms
41,100 KB
testcase_11 AC 122 ms
41,108 KB
testcase_12 AC 111 ms
41,320 KB
testcase_13 AC 128 ms
41,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		String str=sc.next();
		int ans=0;
		for(int i=0;i<str.length();i++){
			if(str.charAt(i)=='…'){
				int t=1; i++;
				while(i<str.length() && str.charAt(i)=='…'){
					t++; i++;
				}
				ans=Math.max(ans,t);
			}
		}
		System.out.println(ans);
	}
}
0