結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー bell
提出日時 2021-02-16 12:08:38
言語 Java
(openjdk 23)
結果
AC  
実行時間 131 ms / 1,000 ms
コード長 794 bytes
コンパイル時間 2,723 ms
コンパイル使用メモリ 74,436 KB
実行使用メモリ 54,376 KB
最終ジャッジ日時 2024-09-12 22:27:07
合計ジャッジ時間 7,956 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

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