結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー 🐧しゅんチャマ🌸🐧しゅんチャマ🌸
提出日時 2023-09-14 22:01:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 1,000 ms
コード長 796 bytes
コンパイル時間 1,956 ms
コンパイル使用メモリ 71,556 KB
実行使用メモリ 56,424 KB
最終ジャッジ日時 2023-09-14 22:01:39
合計ジャッジ時間 6,914 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,528 KB
testcase_01 AC 121 ms
55,948 KB
testcase_02 AC 119 ms
55,648 KB
testcase_03 AC 120 ms
55,628 KB
testcase_04 AC 119 ms
55,344 KB
testcase_05 AC 118 ms
55,388 KB
testcase_06 AC 118 ms
55,688 KB
testcase_07 AC 120 ms
56,016 KB
testcase_08 AC 121 ms
55,556 KB
testcase_09 AC 120 ms
55,932 KB
testcase_10 AC 119 ms
55,344 KB
testcase_11 AC 121 ms
55,636 KB
testcase_12 AC 123 ms
55,428 KB
testcase_13 AC 122 ms
55,508 KB
testcase_14 AC 121 ms
55,828 KB
testcase_15 AC 119 ms
55,668 KB
testcase_16 AC 122 ms
55,564 KB
testcase_17 AC 124 ms
55,908 KB
testcase_18 AC 122 ms
55,932 KB
testcase_19 AC 120 ms
55,944 KB
testcase_20 AC 120 ms
55,456 KB
testcase_21 AC 119 ms
55,700 KB
testcase_22 AC 127 ms
55,632 KB
testcase_23 AC 121 ms
55,864 KB
testcase_24 AC 120 ms
55,624 KB
testcase_25 AC 121 ms
55,344 KB
testcase_26 AC 124 ms
56,424 KB
testcase_27 AC 119 ms
55,724 KB
testcase_28 AC 119 ms
55,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Y203{
    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        String w1=sc.next();
        String w2=sc.next();
        int count=0;
        int ans=-2000000000;
        for(int i=0;i<w1.length();i++){
            char ch=w1.charAt(i);
            if(ch=='o'){
                count++;
            }else{
                count=0;
            }
            if(ans<=count){
                ans=count;
            }
        }
        for(int i=0;i<w2.length();i++){
            char ch=w2.charAt(i);
            if(ch=='o'){
                count++;
            }else{
                count=0;
            }
            if(ans<=count){
                ans=count;
            }
        }
        System.out.println(ans);
    }
}
0