結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー omc-testomc-test
提出日時 2016-08-22 08:38:52
言語 Java21
(openjdk 21)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 778 bytes
コンパイル時間 3,832 ms
コンパイル使用メモリ 72,360 KB
実行使用メモリ 51,248 KB
最終ジャッジ日時 2023-08-11 07:28:00
合計ジャッジ時間 6,741 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
51,248 KB
testcase_01 AC 42 ms
49,316 KB
testcase_02 AC 42 ms
49,224 KB
testcase_03 AC 43 ms
49,492 KB
testcase_04 AC 42 ms
49,260 KB
testcase_05 AC 43 ms
47,284 KB
testcase_06 AC 44 ms
49,120 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 43 ms
49,656 KB
testcase_10 AC 42 ms
49,188 KB
testcase_11 AC 43 ms
49,188 KB
testcase_12 AC 43 ms
49,372 KB
testcase_13 AC 43 ms
49,856 KB
testcase_14 AC 42 ms
49,536 KB
testcase_15 AC 43 ms
49,644 KB
testcase_16 AC 44 ms
49,120 KB
testcase_17 AC 42 ms
49,292 KB
testcase_18 AC 43 ms
49,488 KB
testcase_19 AC 43 ms
49,292 KB
testcase_20 AC 42 ms
49,320 KB
testcase_21 AC 43 ms
49,120 KB
testcase_22 AC 43 ms
49,372 KB
testcase_23 AC 42 ms
49,116 KB
testcase_24 AC 42 ms
49,108 KB
testcase_25 AC 42 ms
47,336 KB
testcase_26 AC 42 ms
49,200 KB
testcase_27 AC 42 ms
49,436 KB
testcase_28 AC 42 ms
49,124 KB
権限があれば一括ダウンロードができます

ソースコード

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