結果

問題 No.341 沈黙の期間
ユーザー shinwisteriashinwisteria
提出日時 2017-04-15 15:49:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 5,000 ms
コード長 476 bytes
コンパイル時間 5,430 ms
コンパイル使用メモリ 72,120 KB
実行使用メモリ 57,784 KB
最終ジャッジ日時 2023-09-25 22:16:06
合計ジャッジ時間 5,923 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,572 KB
testcase_01 AC 120 ms
55,620 KB
testcase_02 AC 119 ms
55,300 KB
testcase_03 AC 118 ms
55,340 KB
testcase_04 AC 118 ms
55,568 KB
testcase_05 AC 118 ms
55,756 KB
testcase_06 AC 118 ms
55,720 KB
testcase_07 AC 119 ms
55,720 KB
testcase_08 AC 119 ms
57,784 KB
testcase_09 AC 121 ms
55,364 KB
testcase_10 AC 121 ms
55,944 KB
testcase_11 AC 118 ms
55,568 KB
testcase_12 AC 120 ms
55,724 KB
testcase_13 AC 120 ms
55,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Sirent {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		StringBuilder str = new StringBuilder(s.next());
		s.close();
		int a = 0,b = 0;
		String ten = "…";
		while(str.indexOf(ten) != -1){
			if(str.indexOf(ten) == 0){
				b++;
				str.deleteCharAt(0);
			}else{
				a =Math.max(a, b);
				b = 1;
				str.delete(0, str.indexOf(ten)+1);
			}
		}
		a = Math.max(a, b);
		System.out.println(a);

	}

}
0