結果

問題 No.341 沈黙の期間
ユーザー yagi2yagi2
提出日時 2017-04-20 12:48:02
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 572 bytes
コンパイル時間 2,078 ms
コンパイル使用メモリ 71,592 KB
実行使用メモリ 56,556 KB
最終ジャッジ日時 2023-09-27 03:17:27
合計ジャッジ時間 4,799 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,828 KB
testcase_01 AC 116 ms
55,936 KB
testcase_02 AC 116 ms
56,520 KB
testcase_03 AC 117 ms
56,556 KB
testcase_04 AC 119 ms
55,824 KB
testcase_05 AC 116 ms
55,980 KB
testcase_06 AC 116 ms
55,436 KB
testcase_07 AC 117 ms
55,788 KB
testcase_08 AC 115 ms
55,848 KB
testcase_09 AC 116 ms
54,144 KB
testcase_10 AC 120 ms
56,064 KB
testcase_11 WA -
testcase_12 AC 119 ms
56,112 KB
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();

        int max = -1;

        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == '…') {
                int tmp = 1;
                for (int j = i + 1; j < S.length(); j++) {
                    if (S.charAt(j) != '…') break;
                    tmp++;
                }
                if (max < tmp) max = tmp;
            }
        }

        System.out.println(max);
    }
}
0