結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー tsunabittsunabit
提出日時 2018-05-13 02:23:09
言語 Java
(openjdk 23)
結果
AC  
実行時間 139 ms / 1,000 ms
コード長 782 bytes
コンパイル時間 3,572 ms
コンパイル使用メモリ 74,728 KB
実行使用メモリ 54,524 KB
最終ジャッジ日時 2024-11-18 10:27:19
合計ジャッジ時間 8,425 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

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