結果

問題 No.341 沈黙の期間
ユーザー atkrymatkrym
提出日時 2016-10-19 14:01:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 5,000 ms
コード長 501 bytes
コンパイル時間 2,335 ms
コンパイル使用メモリ 74,048 KB
実行使用メモリ 41,412 KB
最終ジャッジ日時 2024-05-02 04:33:38
合計ジャッジ時間 4,781 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
40,976 KB
testcase_01 AC 126 ms
41,060 KB
testcase_02 AC 129 ms
40,920 KB
testcase_03 AC 129 ms
40,880 KB
testcase_04 AC 125 ms
40,924 KB
testcase_05 AC 127 ms
41,080 KB
testcase_06 AC 126 ms
40,940 KB
testcase_07 AC 128 ms
41,412 KB
testcase_08 AC 115 ms
39,960 KB
testcase_09 AC 125 ms
41,156 KB
testcase_10 AC 129 ms
41,044 KB
testcase_11 AC 129 ms
40,864 KB
testcase_12 AC 134 ms
41,324 KB
testcase_13 AC 130 ms
41,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    private static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        String s = sc.next();
        int ret = 0;
        int tmp = 0;
        for (int i = 0;i < s.length();i++) {
            if (s.substring(i, i+1).equals("…")) {
                tmp++;
            } else {
                tmp = 0;
            }
            ret = Math.max(ret, tmp);
        }
        System.out.println(ret);
    }
}
0