結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー tsunabittsunabit
提出日時 2018-05-13 02:23:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 1,000 ms
コード長 782 bytes
コンパイル時間 3,475 ms
コンパイル使用メモリ 73,892 KB
実行使用メモリ 55,864 KB
最終ジャッジ日時 2023-08-11 16:45:44
合計ジャッジ時間 8,493 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,384 KB
testcase_01 AC 128 ms
55,380 KB
testcase_02 AC 128 ms
55,608 KB
testcase_03 AC 125 ms
55,676 KB
testcase_04 AC 127 ms
55,296 KB
testcase_05 AC 126 ms
55,680 KB
testcase_06 AC 126 ms
55,684 KB
testcase_07 AC 127 ms
53,756 KB
testcase_08 AC 128 ms
55,720 KB
testcase_09 AC 128 ms
55,532 KB
testcase_10 AC 126 ms
55,644 KB
testcase_11 AC 125 ms
55,496 KB
testcase_12 AC 128 ms
55,376 KB
testcase_13 AC 125 ms
55,620 KB
testcase_14 AC 128 ms
55,864 KB
testcase_15 AC 125 ms
55,612 KB
testcase_16 AC 127 ms
55,300 KB
testcase_17 AC 126 ms
55,808 KB
testcase_18 AC 124 ms
55,852 KB
testcase_19 AC 128 ms
55,524 KB
testcase_20 AC 124 ms
55,644 KB
testcase_21 AC 128 ms
55,532 KB
testcase_22 AC 124 ms
55,636 KB
testcase_23 AC 125 ms
55,604 KB
testcase_24 AC 125 ms
55,588 KB
testcase_25 AC 125 ms
55,576 KB
testcase_26 AC 124 ms
55,296 KB
testcase_27 AC 125 ms
55,856 KB
testcase_28 AC 125 ms
55,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No203 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] w1 = sc.nextLine().split("", 0);
        String[] w2 = sc.nextLine().split("", 0);
        String[] w = new String[w1.length + w2.length];
        System.arraycopy(w1, 0, w, 0, w1.length);
        System.arraycopy(w2, 0, w, w1.length, w2.length);
        int count = 0;
        int max = 0;
        for(int i = 0; i < w.length; i++) {
            if("o".equals(w[i])) {
                count++;
            }
            else {
                if(count > max) {
                    max = count;
                }
                count = 0;
            }
        }
        System.out.println(max > count ? max : count);
    }
}
0