結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー matsuyoshi30matsuyoshi30
提出日時 2017-01-19 23:02:30
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 811 bytes
コンパイル時間 3,655 ms
コンパイル使用メモリ 84,804 KB
実行使用メモリ 57,804 KB
最終ジャッジ日時 2023-08-24 17:17:36
合計ジャッジ時間 8,087 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 115 ms
55,760 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 120 ms
55,840 KB
testcase_10 AC 119 ms
55,760 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 116 ms
55,844 KB
testcase_14 AC 116 ms
55,580 KB
testcase_15 AC 116 ms
55,768 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 116 ms
55,396 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 117 ms
55,920 KB
testcase_22 AC 117 ms
55,508 KB
testcase_23 AC 117 ms
55,340 KB
testcase_24 AC 120 ms
55,880 KB
testcase_25 WA -
testcase_26 AC 118 ms
55,964 KB
testcase_27 AC 119 ms
56,340 KB
testcase_28 AC 117 ms
53,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String week1 = in.next();
        String week2 = in.next();

        String gWeek = week1 + week2;
        int count = 0;
        int max = 0;

        for(int i=0; i<14; i++) {
            if(gWeek.charAt(i) == 'o') {
                count++;
                if(i == 13) {
                    if (count > max) max = count;
                }
            } else {
                if(count > max) {
                    max = count;
                } else {
                    count = 0;
                }
            }
        }

        System.out.println(max);

        in.close();
    }
}
0