結果

問題 No.341 沈黙の期間
ユーザー matsuyoshi30matsuyoshi30
提出日時 2016-02-13 00:29:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 541 bytes
コンパイル時間 2,298 ms
コンパイル使用メモリ 75,724 KB
実行使用メモリ 41,068 KB
最終ジャッジ日時 2023-10-22 03:47:13
合計ジャッジ時間 4,981 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
40,780 KB
testcase_01 AC 125 ms
41,068 KB
testcase_02 AC 113 ms
39,812 KB
testcase_03 AC 113 ms
39,832 KB
testcase_04 AC 129 ms
41,004 KB
testcase_05 AC 112 ms
39,816 KB
testcase_06 AC 112 ms
39,820 KB
testcase_07 AC 124 ms
40,896 KB
testcase_08 AC 122 ms
41,056 KB
testcase_09 AC 122 ms
40,924 KB
testcase_10 AC 125 ms
40,980 KB
testcase_11 AC 124 ms
41,060 KB
testcase_12 AC 126 ms
40,972 KB
testcase_13 AC 115 ms
39,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main {
    public static final char dots = '…';
    public static void main(String[] args) throws Exception {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        int max = 0;
        int len = 0;
        for(int i=0; i<s.length(); i++) {
            char c = s.charAt(i);
            if(c == dots) {
                len++;
                max = Math.max(max, len);
            } else {
                len = 0;
            }
        }
        System.out.println(max);
    }
}
0