結果

問題 No.341 沈黙の期間
ユーザー kenji_shioyakenji_shioya
提出日時 2016-05-29 17:18:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 5,000 ms
コード長 480 bytes
コンパイル時間 3,418 ms
コンパイル使用メモリ 75,380 KB
実行使用メモリ 41,356 KB
最終ジャッジ日時 2024-04-16 18:16:31
合計ジャッジ時間 5,893 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
41,192 KB
testcase_01 AC 128 ms
41,356 KB
testcase_02 AC 124 ms
40,988 KB
testcase_03 AC 127 ms
41,208 KB
testcase_04 AC 115 ms
40,136 KB
testcase_05 AC 127 ms
41,208 KB
testcase_06 AC 129 ms
41,260 KB
testcase_07 AC 114 ms
40,028 KB
testcase_08 AC 129 ms
41,308 KB
testcase_09 AC 128 ms
41,312 KB
testcase_10 AC 130 ms
41,260 KB
testcase_11 AC 127 ms
41,176 KB
testcase_12 AC 129 ms
41,264 KB
testcase_13 AC 115 ms
40,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Exercise32{
  public static void main (String[] args){

    Scanner sc = new Scanner(System.in);

    String str = sc.next();
    char[] charArray = str.toCharArray();
    int count = 0;
    int max = 0;

    for (int n = 0; n < charArray.length; n++){
      if(charArray[n] == '…'){
          count++;
      }else if (charArray[n] != '…'){
        count = 0;
      }
      max = Math.max(max, count);
    }
    System.out.println(max);
  }
}
0