結果

問題 No.341 沈黙の期間
ユーザー chiyodachiyoda
提出日時 2016-06-22 12:22:17
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 2,179 ms
コンパイル使用メモリ 74,696 KB
実行使用メモリ 41,228 KB
最終ジャッジ日時 2024-04-20 00:18:37
合計ジャッジ時間 3,843 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
40,960 KB
testcase_01 AC 105 ms
40,784 KB
testcase_02 WA -
testcase_03 AC 103 ms
40,904 KB
testcase_04 AC 94 ms
39,724 KB
testcase_05 AC 114 ms
41,076 KB
testcase_06 AC 99 ms
39,580 KB
testcase_07 AC 88 ms
39,428 KB
testcase_08 AC 106 ms
40,940 KB
testcase_09 AC 93 ms
39,724 KB
testcase_10 AC 102 ms
40,896 KB
testcase_11 AC 101 ms
40,776 KB
testcase_12 WA -
testcase_13 AC 95 ms
39,636 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++;
        } else {
          max = Math.max(cnt, max);
          cnt = 0;
        }
    }
    System.out.println(max);
  }
}
0