結果

問題 No.341 沈黙の期間
ユーザー tsunabittsunabit
提出日時 2019-05-26 21:24:04
言語 Java19
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 635 bytes
コンパイル時間 3,383 ms
コンパイル使用メモリ 78,888 KB
実行使用メモリ 57,640 KB
最終ジャッジ日時 2023-10-17 18:05:03
合計ジャッジ時間 5,953 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
57,100 KB
testcase_01 AC 127 ms
57,452 KB
testcase_02 AC 126 ms
57,256 KB
testcase_03 AC 126 ms
57,460 KB
testcase_04 AC 126 ms
57,640 KB
testcase_05 AC 124 ms
57,404 KB
testcase_06 AC 124 ms
57,352 KB
testcase_07 AC 125 ms
57,348 KB
testcase_08 AC 124 ms
57,368 KB
testcase_09 AC 126 ms
57,604 KB
testcase_10 AC 128 ms
57,400 KB
testcase_11 AC 127 ms
57,576 KB
testcase_12 AC 126 ms
57,592 KB
testcase_13 AC 126 ms
55,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Scanner;
import java.util.Collections;
import java.util.Arrays;

public class No341 {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner s = new Scanner(System.in);
        String ss = s.next();
        char[] a = ss.toCharArray();
        int max = 0, c = 0;
        for(char b : a) {
        	if('…' == b) {
        		c += 1;
        	}else {
        		max = max < c? c : max;
        		c = 0;
        	}
        }
        max = max < c? c : max;
        System.out.println(max);
    }
}
0