結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー thorikawathorikawa
提出日時 2015-05-08 22:30:41
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 946 bytes
コンパイル時間 2,489 ms
コンパイル使用メモリ 85,296 KB
実行使用メモリ 41,652 KB
最終ジャッジ日時 2024-04-21 12:56:01
合計ジャッジ時間 8,668 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 RE -
testcase_03 RE -
testcase_04 AC 98 ms
41,212 KB
testcase_05 AC 101 ms
41,064 KB
testcase_06 AC 117 ms
41,584 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 104 ms
41,332 KB
testcase_13 WA -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 WA -
testcase_21 RE -
testcase_22 WA -
testcase_23 RE -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 RE -
testcase_28 WA -
testcase_29 AC 112 ms
41,348 KB
testcase_30 AC 107 ms
41,184 KB
testcase_31 RE -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 113 ms
41,336 KB
testcase_35 AC 123 ms
41,044 KB
testcase_36 AC 118 ms
41,128 KB
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 AC 97 ms
41,184 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 102 ms
41,036 KB
testcase_44 AC 112 ms
41,112 KB
testcase_45 RE -
testcase_46 AC 111 ms
41,008 KB
testcase_47 WA -
testcase_48 WA -
権限があれば一括ダウンロードができます

ソースコード

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();
        int res = 0;
        for (int i = 0; i < 14; ++i) {
            boolean ok = true;
            for (int j = 0; j < d; ++j) {
                if (s.charAt(i + j) == 'o') {
                    ok = false;
                    break;
                }
            }
            if (!ok) continue;
            int count = 0;
            for (int j = 0; j < 14; ++j) {
                boolean isYukyu = (j - i >= 0) && ((j - i) < d);
                if (s.charAt(j) == 'o' || isYukyu) {
                    count++;
                    res = Math.max(res, count);
                } else {
                    count = 0;
                }
            }
        }
        System.out.println(res);
    }
}
0