結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー omc-testomc-test
提出日時 2016-12-14 15:58:50
言語 Java19
(openjdk 21)
結果
AC  
実行時間 46 ms / 1,000 ms
コード長 827 bytes
コンパイル時間 3,438 ms
コンパイル使用メモリ 73,884 KB
実行使用メモリ 49,424 KB
最終ジャッジ日時 2023-08-11 16:25:50
合計ジャッジ時間 5,910 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,168 KB
testcase_01 AC 44 ms
49,128 KB
testcase_02 AC 44 ms
49,176 KB
testcase_03 AC 44 ms
49,000 KB
testcase_04 AC 44 ms
49,308 KB
testcase_05 AC 44 ms
49,172 KB
testcase_06 AC 44 ms
49,424 KB
testcase_07 AC 45 ms
49,124 KB
testcase_08 AC 45 ms
49,096 KB
testcase_09 AC 44 ms
49,400 KB
testcase_10 AC 44 ms
49,208 KB
testcase_11 AC 44 ms
49,212 KB
testcase_12 AC 45 ms
49,424 KB
testcase_13 AC 46 ms
49,412 KB
testcase_14 AC 44 ms
49,132 KB
testcase_15 AC 44 ms
49,144 KB
testcase_16 AC 43 ms
49,124 KB
testcase_17 AC 45 ms
49,368 KB
testcase_18 AC 44 ms
49,060 KB
testcase_19 AC 45 ms
49,204 KB
testcase_20 AC 45 ms
49,288 KB
testcase_21 AC 44 ms
49,000 KB
testcase_22 AC 44 ms
49,080 KB
testcase_23 AC 45 ms
49,148 KB
testcase_24 AC 44 ms
49,008 KB
testcase_25 AC 45 ms
49,112 KB
testcase_26 AC 44 ms
49,004 KB
testcase_27 AC 44 ms
49,352 KB
testcase_28 AC 44 ms
49,204 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