結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー kenji_shioyakenji_shioya
提出日時 2016-06-23 01:07:09
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 767 bytes
コンパイル時間 4,808 ms
コンパイル使用メモリ 80,800 KB
実行使用メモリ 42,908 KB
最終ジャッジ日時 2024-04-21 15:14:52
合計ジャッジ時間 13,542 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 168 ms
42,428 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 172 ms
42,436 KB
testcase_05 AC 171 ms
42,624 KB
testcase_06 AC 170 ms
42,744 KB
testcase_07 AC 167 ms
42,420 KB
testcase_08 AC 156 ms
42,236 KB
testcase_09 AC 169 ms
42,400 KB
testcase_10 AC 166 ms
42,488 KB
testcase_11 WA -
testcase_12 AC 167 ms
42,520 KB
testcase_13 AC 166 ms
42,420 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 169 ms
42,472 KB
testcase_17 AC 169 ms
42,684 KB
testcase_18 AC 166 ms
42,532 KB
testcase_19 AC 170 ms
42,568 KB
testcase_20 AC 172 ms
42,244 KB
testcase_21 AC 167 ms
42,392 KB
testcase_22 AC 168 ms
42,324 KB
testcase_23 AC 170 ms
42,372 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 167 ms
42,324 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 168 ms
42,576 KB
testcase_30 AC 169 ms
42,648 KB
testcase_31 AC 155 ms
42,396 KB
testcase_32 AC 187 ms
42,456 KB
testcase_33 AC 175 ms
42,400 KB
testcase_34 AC 169 ms
42,372 KB
testcase_35 AC 167 ms
42,404 KB
testcase_36 AC 169 ms
42,584 KB
testcase_37 AC 173 ms
42,436 KB
testcase_38 AC 176 ms
42,624 KB
testcase_39 AC 169 ms
42,500 KB
testcase_40 AC 169 ms
42,448 KB
testcase_41 AC 169 ms
42,584 KB
testcase_42 AC 173 ms
42,528 KB
testcase_43 AC 170 ms
42,568 KB
testcase_44 AC 166 ms
42,504 KB
testcase_45 AC 165 ms
42,408 KB
testcase_46 AC 166 ms
42,664 KB
testcase_47 WA -
testcase_48 AC 167 ms
42,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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

    Scanner sc = new Scanner(System.in);

    int d = sc.nextInt();
    String plus = "xxxxxxxxxxxxxx";
    String weeks = sc.next() + sc.next() + plus;
    char[] wa = weeks.toCharArray();
    int max = 0;
    for(int i = 0; i < wa.length; i++){
      if(wa[i] == 'x'){
        char[] wd = Arrays.copyOf(wa, wa.length);
        for(int j = 0; j < d && i + j < wd.length; j++){
          wd[i + j] = 'o';
        }
        int oCount = 0;
        for(char charInWd: wd){
          if(charInWd == 'o'){
            oCount++;
            max = Math.max(max, oCount);
          }else{
            oCount = 0;
          }
        }
      }
    }
    System.out.println(max);
  }
}
0