結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー omc-testomc-test
提出日時 2016-12-14 15:58:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 58 ms / 1,000 ms
コード長 827 bytes
コンパイル時間 3,587 ms
コンパイル使用メモリ 76,872 KB
実行使用メモリ 50,456 KB
最終ジャッジ日時 2024-11-18 09:57:24
合計ジャッジ時間 6,102 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
50,340 KB
testcase_01 AC 55 ms
50,276 KB
testcase_02 AC 54 ms
50,456 KB
testcase_03 AC 54 ms
50,132 KB
testcase_04 AC 55 ms
50,272 KB
testcase_05 AC 54 ms
50,372 KB
testcase_06 AC 54 ms
50,300 KB
testcase_07 AC 56 ms
50,100 KB
testcase_08 AC 55 ms
50,368 KB
testcase_09 AC 54 ms
50,116 KB
testcase_10 AC 55 ms
50,280 KB
testcase_11 AC 55 ms
50,296 KB
testcase_12 AC 54 ms
50,292 KB
testcase_13 AC 55 ms
49,984 KB
testcase_14 AC 54 ms
50,260 KB
testcase_15 AC 54 ms
50,320 KB
testcase_16 AC 54 ms
50,380 KB
testcase_17 AC 55 ms
50,036 KB
testcase_18 AC 54 ms
50,056 KB
testcase_19 AC 54 ms
50,288 KB
testcase_20 AC 54 ms
50,040 KB
testcase_21 AC 54 ms
50,120 KB
testcase_22 AC 55 ms
50,268 KB
testcase_23 AC 58 ms
50,268 KB
testcase_24 AC 55 ms
50,140 KB
testcase_25 AC 54 ms
50,368 KB
testcase_26 AC 53 ms
49,932 KB
testcase_27 AC 55 ms
50,220 KB
testcase_28 AC 57 ms
50,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class No0203 {

	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 ans = Counter(c1, c2);
			System.out.println(ans);

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

	public static int Counter(char c1[], char c2[]){
		int ans = 0;
		int buf = 0;

		for(int i=0; i<c1.length; i++){
			if(c1[i] == 'o'){
				buf++;
			}else{
				ans = Math.max(buf, ans);
				buf = 0;
			}
		}
		for(int i=0; i<c2.length; i++){
			if(c2[i] == 'o'){
				buf++;
			}else{
				ans = Math.max(buf, ans);
				buf = 0;
			}
		}
		ans = Math.max(buf, ans);

		return ans;
	}
}
0