結果

問題 No.341 沈黙の期間
ユーザー chiyodachiyoda
提出日時 2016-06-22 12:27:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 417 bytes
コンパイル時間 1,946 ms
コンパイル使用メモリ 74,412 KB
実行使用メモリ 54,224 KB
最終ジャッジ日時 2024-04-20 00:19:12
合計ジャッジ時間 4,191 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
54,096 KB
testcase_01 AC 105 ms
54,192 KB
testcase_02 AC 112 ms
54,224 KB
testcase_03 AC 119 ms
53,884 KB
testcase_04 AC 121 ms
54,000 KB
testcase_05 AC 115 ms
54,144 KB
testcase_06 AC 123 ms
54,124 KB
testcase_07 AC 98 ms
52,388 KB
testcase_08 AC 110 ms
54,060 KB
testcase_09 AC 116 ms
54,164 KB
testcase_10 AC 121 ms
54,168 KB
testcase_11 AC 109 ms
53,728 KB
testcase_12 AC 111 ms
54,040 KB
testcase_13 AC 102 ms
53,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public  class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    int cnt = 0;
    int max  = 0;
    for (int i = 0; i < s.length(); i++) {
        if (s.charAt(i) == '…') {
           cnt++;
           max = Math.max(cnt, max);
        } else {
          cnt = 0;
        }
    }
    System.out.println(max);
  }
}
0