結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-04-30 13:11:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 45 ms / 1,000 ms
コード長 1,200 bytes
コンパイル時間 2,305 ms
コンパイル使用メモリ 73,300 KB
実行使用メモリ 49,856 KB
最終ジャッジ日時 2023-08-11 16:32:01
合計ジャッジ時間 4,787 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,412 KB
testcase_01 AC 45 ms
49,400 KB
testcase_02 AC 43 ms
49,628 KB
testcase_03 AC 44 ms
49,276 KB
testcase_04 AC 44 ms
47,260 KB
testcase_05 AC 43 ms
49,356 KB
testcase_06 AC 43 ms
49,496 KB
testcase_07 AC 44 ms
49,644 KB
testcase_08 AC 43 ms
49,284 KB
testcase_09 AC 43 ms
49,276 KB
testcase_10 AC 43 ms
49,544 KB
testcase_11 AC 43 ms
49,640 KB
testcase_12 AC 43 ms
49,504 KB
testcase_13 AC 42 ms
47,840 KB
testcase_14 AC 43 ms
49,404 KB
testcase_15 AC 44 ms
49,624 KB
testcase_16 AC 44 ms
49,284 KB
testcase_17 AC 44 ms
49,856 KB
testcase_18 AC 45 ms
49,412 KB
testcase_19 AC 43 ms
49,296 KB
testcase_20 AC 43 ms
49,408 KB
testcase_21 AC 43 ms
49,608 KB
testcase_22 AC 43 ms
49,292 KB
testcase_23 AC 44 ms
49,436 KB
testcase_24 AC 44 ms
49,404 KB
testcase_25 AC 43 ms
49,396 KB
testcase_26 AC 43 ms
49,348 KB
testcase_27 AC 45 ms
49,408 KB
testcase_28 AC 43 ms
49,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Arrays;

import static java.lang.System.in;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        int[] days = new int[14 + 1];
        String[] inputs = reader.readLine().split("");
        for (int i = 0; i < 7; i++) {
            if (inputs[i].equals("o")) {
                days[i + 1] = 1;
            } else {
                days[i + 1] = 0;
            }
        }

        inputs = reader.readLine().split("");
        for (int i = 7; i < 14; i++) {
            if (inputs[i - 7].equals("o")) {
                days[i+1] = 1;
            } else {
                days[i+1] = 0;
            }
        }
        for (int i = 1; i <= 14; i++) {
            if (days[i] == 0) {
            } else {
                days[i] = days[i] + days[i - 1];
            }
        }
        int longest=0;
        for (int i = 0; i <= 14; i++) {
            longest = Math.max(longest,days[i]);
        }
        System.out.println(longest);
    }
}
0