結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
56,100 KB
testcase_01 AC 121 ms
55,952 KB
testcase_02 AC 120 ms
55,432 KB
testcase_03 AC 119 ms
55,880 KB
testcase_04 AC 121 ms
55,636 KB
testcase_05 AC 121 ms
55,844 KB
testcase_06 AC 121 ms
55,712 KB
testcase_07 AC 122 ms
55,892 KB
testcase_08 AC 124 ms
55,820 KB
testcase_09 AC 121 ms
55,684 KB
testcase_10 AC 120 ms
55,536 KB
testcase_11 AC 121 ms
55,800 KB
testcase_12 AC 123 ms
55,736 KB
testcase_13 AC 120 ms
56,008 KB
testcase_14 AC 120 ms
55,716 KB
testcase_15 AC 121 ms
55,796 KB
testcase_16 AC 122 ms
55,768 KB
testcase_17 AC 121 ms
55,716 KB
testcase_18 AC 121 ms
55,476 KB
testcase_19 AC 121 ms
55,704 KB
testcase_20 AC 124 ms
55,400 KB
testcase_21 AC 121 ms
55,840 KB
testcase_22 AC 121 ms
55,636 KB
testcase_23 AC 121 ms
55,784 KB
testcase_24 AC 119 ms
55,624 KB
testcase_25 AC 119 ms
55,636 KB
testcase_26 AC 119 ms
55,748 KB
testcase_27 AC 120 ms
55,536 KB
testcase_28 AC 120 ms
55,736 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