結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー kou6839kou6839
提出日時 2015-05-09 14:13:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 1,000 ms
コード長 511 bytes
コンパイル時間 5,311 ms
コンパイル使用メモリ 74,272 KB
実行使用メモリ 56,208 KB
最終ジャッジ日時 2023-08-11 15:40:12
合計ジャッジ時間 7,082 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,420 KB
testcase_01 AC 125 ms
55,704 KB
testcase_02 AC 123 ms
55,684 KB
testcase_03 AC 125 ms
55,504 KB
testcase_04 AC 125 ms
53,804 KB
testcase_05 AC 125 ms
55,816 KB
testcase_06 AC 121 ms
55,208 KB
testcase_07 AC 122 ms
55,676 KB
testcase_08 AC 124 ms
55,508 KB
testcase_09 AC 120 ms
55,916 KB
testcase_10 AC 121 ms
56,208 KB
testcase_11 AC 121 ms
55,680 KB
testcase_12 AC 121 ms
55,760 KB
testcase_13 AC 120 ms
55,252 KB
testcase_14 AC 119 ms
55,232 KB
testcase_15 AC 121 ms
55,540 KB
testcase_16 AC 123 ms
55,428 KB
testcase_17 AC 121 ms
55,488 KB
testcase_18 AC 121 ms
55,504 KB
testcase_19 AC 123 ms
55,248 KB
testcase_20 AC 122 ms
55,228 KB
testcase_21 AC 122 ms
55,404 KB
testcase_22 AC 121 ms
55,940 KB
testcase_23 AC 120 ms
55,508 KB
testcase_24 AC 121 ms
55,476 KB
testcase_25 AC 122 ms
55,428 KB
testcase_26 AC 121 ms
55,576 KB
testcase_27 AC 122 ms
55,584 KB
testcase_28 AC 121 ms
55,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.File;
import java.util.*;

public class Main {
	public static void main(String[] args){
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String a = sc.next();
		String b = sc.next();
		a+=b;
		int ans=0;
		for(int i=0;i<a.length();i++){
			if(a.charAt(i)=='o'){
				int temp=1;
				int j=1;
				while(i+j<a.length() && a.charAt(i+j)=='o'){
					j++;
					temp++;
				}
				ans=Math.max(ans, temp);
				i+=j;
			}
		}
		System.out.println(ans);
	}
}
0