結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 164 ms
41,356 KB
testcase_03 AC 165 ms
41,540 KB
testcase_04 AC 168 ms
41,504 KB
testcase_05 AC 162 ms
41,296 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 165 ms
41,504 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 156 ms
41,728 KB
testcase_26 WA -
testcase_27 AC 153 ms
41,656 KB
testcase_28 WA -
testcase_29 AC 159 ms
41,668 KB
testcase_30 AC 154 ms
41,368 KB
testcase_31 AC 152 ms
41,572 KB
testcase_32 AC 154 ms
41,248 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 158 ms
41,520 KB
testcase_36 AC 159 ms
41,420 KB
testcase_37 WA -
testcase_38 AC 156 ms
41,616 KB
testcase_39 AC 155 ms
41,368 KB
testcase_40 AC 151 ms
41,560 KB
testcase_41 AC 153 ms
41,420 KB
testcase_42 WA -
testcase_43 AC 162 ms
41,776 KB
testcase_44 AC 161 ms
41,556 KB
testcase_45 AC 157 ms
41,536 KB
testcase_46 AC 165 ms
41,128 KB
testcase_47 WA -
testcase_48 AC 158 ms
41,676 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 < 14 - 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