結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー omc-test
提出日時 2016-08-22 08:38:52
言語 Java
(openjdk 23)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 778 bytes
コンパイル時間 4,512 ms
コンパイル使用メモリ 73,292 KB
実行使用メモリ 37,224 KB
最終ジャッジ日時 2024-11-17 21:36:06
合計ジャッジ時間 6,691 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No0203 {
	public static boolean flg = false;

	public static void main(String[] args){
		try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
			char c1[] = br.readLine().toCharArray();
			char c2[] = br.readLine().toCharArray();
			int cnt = 0;
			int ans = Counter(c2, Counter(c1, cnt));
			System.out.println(ans);

		}catch(IOException e){
			e.printStackTrace();
		}
	}

	public static int Counter(char c[], int cnt){
		int ans = 0;
		if(flg){
			ans = cnt;
		}
		for(int i=0; i<c.length; i++){
			if(c[i] == 'o'){
				ans++;
				cnt = Math.max(cnt, ans);
				flg = true;
			}else{
				flg = false;
				ans = 0;
			}

		}
		return cnt;
	}
}
0