結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー thorikawathorikawa
提出日時 2015-05-08 23:15:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 144 ms / 1,000 ms
コード長 1,028 bytes
コンパイル時間 3,446 ms
コンパイル使用メモリ 73,992 KB
実行使用メモリ 58,600 KB
最終ジャッジ日時 2023-08-25 23:35:14
合計ジャッジ時間 10,095 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
56,884 KB
testcase_01 AC 127 ms
57,104 KB
testcase_02 AC 128 ms
56,820 KB
testcase_03 AC 130 ms
56,984 KB
testcase_04 AC 143 ms
56,564 KB
testcase_05 AC 130 ms
57,008 KB
testcase_06 AC 131 ms
57,080 KB
testcase_07 AC 129 ms
57,132 KB
testcase_08 AC 133 ms
56,572 KB
testcase_09 AC 126 ms
56,532 KB
testcase_10 AC 133 ms
57,092 KB
testcase_11 AC 130 ms
56,956 KB
testcase_12 AC 126 ms
56,864 KB
testcase_13 AC 132 ms
56,532 KB
testcase_14 AC 133 ms
56,504 KB
testcase_15 AC 131 ms
56,872 KB
testcase_16 AC 133 ms
56,824 KB
testcase_17 AC 144 ms
56,564 KB
testcase_18 AC 133 ms
56,732 KB
testcase_19 AC 132 ms
56,776 KB
testcase_20 AC 125 ms
56,636 KB
testcase_21 AC 143 ms
56,948 KB
testcase_22 AC 140 ms
56,868 KB
testcase_23 AC 132 ms
56,804 KB
testcase_24 AC 136 ms
57,188 KB
testcase_25 AC 135 ms
58,600 KB
testcase_26 AC 132 ms
56,956 KB
testcase_27 AC 131 ms
56,900 KB
testcase_28 AC 135 ms
56,808 KB
testcase_29 AC 136 ms
56,872 KB
testcase_30 AC 143 ms
56,860 KB
testcase_31 AC 128 ms
56,784 KB
testcase_32 AC 130 ms
56,988 KB
testcase_33 AC 127 ms
56,440 KB
testcase_34 AC 133 ms
56,564 KB
testcase_35 AC 136 ms
56,652 KB
testcase_36 AC 132 ms
57,048 KB
testcase_37 AC 129 ms
56,964 KB
testcase_38 AC 133 ms
56,784 KB
testcase_39 AC 130 ms
57,068 KB
testcase_40 AC 131 ms
56,932 KB
testcase_41 AC 134 ms
56,856 KB
testcase_42 AC 131 ms
56,692 KB
testcase_43 AC 129 ms
56,804 KB
testcase_44 AC 132 ms
56,920 KB
testcase_45 AC 133 ms
56,756 KB
testcase_46 AC 133 ms
56,508 KB
testcase_47 AC 130 ms
56,496 KB
testcase_48 AC 133 ms
56,892 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 = "xxxxxxxxxxxxxx" + s + "xxxxxxxxxxxxxx";
        int res = 0;
        for (int i = 0; i < 42; ++i) {
            int len = 0;
            for (int j = 0; j < d && j < 42 - i; ++j) {
                if (s.charAt(i + j) == 'o') {
                    break;
                }
                len++;
            }
            int count = 0;
            for (int j = 0; j < 42; ++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