結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー tsunabittsunabit
提出日時 2018-05-13 02:23:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 1,000 ms
コード長 782 bytes
コンパイル時間 3,465 ms
コンパイル使用メモリ 78,264 KB
実行使用メモリ 41,484 KB
最終ジャッジ日時 2024-04-29 08:34:12
合計ジャッジ時間 7,919 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
41,176 KB
testcase_01 AC 127 ms
41,264 KB
testcase_02 AC 109 ms
39,944 KB
testcase_03 AC 126 ms
41,012 KB
testcase_04 AC 125 ms
41,096 KB
testcase_05 AC 127 ms
41,012 KB
testcase_06 AC 129 ms
41,336 KB
testcase_07 AC 119 ms
40,156 KB
testcase_08 AC 114 ms
40,128 KB
testcase_09 AC 129 ms
41,356 KB
testcase_10 AC 128 ms
41,224 KB
testcase_11 AC 132 ms
41,056 KB
testcase_12 AC 129 ms
41,328 KB
testcase_13 AC 127 ms
41,148 KB
testcase_14 AC 127 ms
41,076 KB
testcase_15 AC 131 ms
41,072 KB
testcase_16 AC 125 ms
41,064 KB
testcase_17 AC 125 ms
41,164 KB
testcase_18 AC 112 ms
40,248 KB
testcase_19 AC 126 ms
41,164 KB
testcase_20 AC 125 ms
41,356 KB
testcase_21 AC 111 ms
39,816 KB
testcase_22 AC 125 ms
41,156 KB
testcase_23 AC 114 ms
40,032 KB
testcase_24 AC 126 ms
41,348 KB
testcase_25 AC 129 ms
41,484 KB
testcase_26 AC 122 ms
41,388 KB
testcase_27 AC 111 ms
39,908 KB
testcase_28 AC 125 ms
41,024 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