結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー bellbell
提出日時 2021-02-16 12:08:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 1,000 ms
コード長 794 bytes
コンパイル時間 2,454 ms
コンパイル使用メモリ 73,064 KB
実行使用メモリ 56,048 KB
最終ジャッジ日時 2023-10-09 23:59:28
合計ジャッジ時間 7,370 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
55,868 KB
testcase_01 AC 110 ms
55,744 KB
testcase_02 AC 111 ms
55,504 KB
testcase_03 AC 117 ms
56,048 KB
testcase_04 AC 117 ms
55,576 KB
testcase_05 AC 115 ms
55,424 KB
testcase_06 AC 116 ms
55,916 KB
testcase_07 AC 115 ms
55,572 KB
testcase_08 AC 112 ms
55,428 KB
testcase_09 AC 113 ms
55,580 KB
testcase_10 AC 116 ms
55,512 KB
testcase_11 AC 118 ms
55,456 KB
testcase_12 AC 117 ms
55,244 KB
testcase_13 AC 117 ms
55,532 KB
testcase_14 AC 119 ms
55,660 KB
testcase_15 AC 119 ms
55,412 KB
testcase_16 AC 116 ms
55,684 KB
testcase_17 AC 115 ms
55,640 KB
testcase_18 AC 114 ms
53,536 KB
testcase_19 AC 112 ms
55,740 KB
testcase_20 AC 113 ms
55,772 KB
testcase_21 AC 115 ms
55,584 KB
testcase_22 AC 113 ms
55,504 KB
testcase_23 AC 113 ms
55,636 KB
testcase_24 AC 121 ms
55,444 KB
testcase_25 AC 114 ms
55,584 KB
testcase_26 AC 118 ms
55,756 KB
testcase_27 AC 118 ms
55,544 KB
testcase_28 AC 116 ms
55,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        String s=sc.next();
        String s2=sc.next();
        int count=0;
        int max=0;

        for( int i=0; i<7; i++){
            char c=s.charAt(i);
            if( c=='o'){
                count++;
            }else {
                count=0;
            }
            if(max<count){
                max=count;
            }
        }

        for( int i=0; i<7; i++){
            char c=s2.charAt(i);
            if( c=='o'){
                count++;
            }else {
                count=0;
            }
            if(max<count){
                max=count;
            }
        }

        System.out.println(max);

        sc.close();
	}
}

0