結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
39,788 KB
testcase_01 AC 91 ms
40,076 KB
testcase_02 WA -
testcase_03 AC 113 ms
40,928 KB
testcase_04 AC 106 ms
40,956 KB
testcase_05 AC 112 ms
41,004 KB
testcase_06 AC 95 ms
40,104 KB
testcase_07 AC 99 ms
40,640 KB
testcase_08 AC 92 ms
39,968 KB
testcase_09 AC 100 ms
40,688 KB
testcase_10 AC 103 ms
40,320 KB
testcase_11 AC 94 ms
39,788 KB
testcase_12 WA -
testcase_13 AC 102 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.next();
    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