結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー thorikawathorikawa
提出日時 2015-05-08 23:14:19
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,014 bytes
コンパイル時間 2,379 ms
コンパイル使用メモリ 82,820 KB
実行使用メモリ 42,168 KB
最終ジャッジ日時 2024-04-21 13:15:28
合計ジャッジ時間 9,375 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
41,544 KB
testcase_01 WA -
testcase_02 AC 127 ms
41,728 KB
testcase_03 AC 114 ms
42,168 KB
testcase_04 AC 127 ms
41,880 KB
testcase_05 AC 129 ms
41,788 KB
testcase_06 AC 127 ms
41,944 KB
testcase_07 WA -
testcase_08 AC 126 ms
42,052 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 110 ms
42,016 KB
testcase_12 AC 116 ms
41,948 KB
testcase_13 WA -
testcase_14 AC 132 ms
41,540 KB
testcase_15 WA -
testcase_16 AC 123 ms
41,804 KB
testcase_17 AC 125 ms
41,792 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 125 ms
41,304 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 124 ms
41,776 KB
testcase_24 WA -
testcase_25 AC 131 ms
42,136 KB
testcase_26 AC 114 ms
41,696 KB
testcase_27 AC 117 ms
41,652 KB
testcase_28 WA -
testcase_29 AC 121 ms
42,016 KB
testcase_30 AC 124 ms
41,636 KB
testcase_31 AC 115 ms
41,556 KB
testcase_32 AC 110 ms
41,848 KB
testcase_33 WA -
testcase_34 AC 126 ms
41,620 KB
testcase_35 AC 129 ms
41,888 KB
testcase_36 AC 123 ms
41,800 KB
testcase_37 AC 108 ms
41,644 KB
testcase_38 AC 123 ms
41,880 KB
testcase_39 AC 114 ms
41,616 KB
testcase_40 AC 124 ms
42,112 KB
testcase_41 AC 130 ms
41,916 KB
testcase_42 WA -
testcase_43 AC 114 ms
41,684 KB
testcase_44 AC 121 ms
41,584 KB
testcase_45 AC 113 ms
41,492 KB
testcase_46 AC 122 ms
41,816 KB
testcase_47 WA -
testcase_48 AC 126 ms
41,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] argv) {
        Scanner scanner = new Scanner(System.in);
        int d = scanner.nextInt();
        String s = scanner.next();
        s += scanner.next();
        s = "xxxxxxx" + s + "xxxxxxx";
        int res = 0;
        for (int i = 0; i < 28; ++i) {
            int len = 0;
            for (int j = 0; j < d && j < 28 - i; ++j) {
                if (s.charAt(i + j) == 'o') {
                    break;
                }
                len++;
            }
            int count = 0;
            for (int j = 0; j < 28; ++j) {
                boolean isYukyu = (j >= i) && ((j - i) < len);
//                boolean isYukyu = (j >= i) && ((j - i) < d);
                if (s.charAt(j) == 'o' || isYukyu) {
                    count++;
                    res = Math.max(res, count);
                } else {
                    count = 0;
                }
            }
        }
        System.out.println(res);
    }
}
0