結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー spacenautspacenaut
提出日時 2016-05-22 16:52:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 1,000 ms
コード長 500 bytes
コンパイル時間 2,227 ms
コンパイル使用メモリ 73,804 KB
実行使用メモリ 56,380 KB
最終ジャッジ日時 2023-08-11 16:12:04
合計ジャッジ時間 7,390 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,440 KB
testcase_01 AC 126 ms
56,380 KB
testcase_02 AC 126 ms
55,476 KB
testcase_03 AC 128 ms
55,688 KB
testcase_04 AC 127 ms
55,772 KB
testcase_05 AC 127 ms
55,312 KB
testcase_06 AC 128 ms
55,316 KB
testcase_07 AC 127 ms
55,316 KB
testcase_08 AC 126 ms
55,440 KB
testcase_09 AC 127 ms
55,436 KB
testcase_10 AC 127 ms
55,636 KB
testcase_11 AC 127 ms
55,436 KB
testcase_12 AC 126 ms
53,876 KB
testcase_13 AC 127 ms
55,512 KB
testcase_14 AC 127 ms
55,808 KB
testcase_15 AC 127 ms
55,436 KB
testcase_16 AC 127 ms
55,556 KB
testcase_17 AC 125 ms
55,632 KB
testcase_18 AC 126 ms
55,572 KB
testcase_19 AC 127 ms
55,520 KB
testcase_20 AC 129 ms
55,592 KB
testcase_21 AC 126 ms
55,316 KB
testcase_22 AC 127 ms
55,580 KB
testcase_23 AC 126 ms
55,240 KB
testcase_24 AC 128 ms
55,316 KB
testcase_25 AC 128 ms
56,116 KB
testcase_26 AC 127 ms
55,436 KB
testcase_27 AC 129 ms
55,700 KB
testcase_28 AC 128 ms
55,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class No0203{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		str = str + sc.next();
		int res = 0;
		int temp = 0;
		for(int i = 0; i < str.length(); i++){
			if(str.charAt(i) == 'o'){
				for(int j = i; j < str.length(); j++){
					if(str.charAt(j) != 'o'){
						break;
					}
					temp++;
				}
				if(temp > res){
					res = temp;
					i = i + temp - 1;
				}
				temp = 0;
			}
		}
		System.out.println(res);
	}
}
0