結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー koukonkokoukonko
提出日時 2015-12-15 15:32:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 57 ms / 1,000 ms
コード長 592 bytes
コンパイル時間 2,147 ms
コンパイル使用メモリ 78,964 KB
実行使用メモリ 37,168 KB
最終ジャッジ日時 2024-04-29 07:59:45
合計ジャッジ時間 4,499 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
37,076 KB
testcase_01 AC 55 ms
36,792 KB
testcase_02 AC 54 ms
37,076 KB
testcase_03 AC 53 ms
36,652 KB
testcase_04 AC 55 ms
36,692 KB
testcase_05 AC 55 ms
36,732 KB
testcase_06 AC 54 ms
36,700 KB
testcase_07 AC 55 ms
36,724 KB
testcase_08 AC 55 ms
37,036 KB
testcase_09 AC 57 ms
36,972 KB
testcase_10 AC 55 ms
37,168 KB
testcase_11 AC 55 ms
37,000 KB
testcase_12 AC 55 ms
36,908 KB
testcase_13 AC 55 ms
36,816 KB
testcase_14 AC 54 ms
36,944 KB
testcase_15 AC 56 ms
36,964 KB
testcase_16 AC 55 ms
37,080 KB
testcase_17 AC 54 ms
37,124 KB
testcase_18 AC 55 ms
36,668 KB
testcase_19 AC 55 ms
36,788 KB
testcase_20 AC 55 ms
36,948 KB
testcase_21 AC 55 ms
36,988 KB
testcase_22 AC 54 ms
36,920 KB
testcase_23 AC 55 ms
36,852 KB
testcase_24 AC 54 ms
37,032 KB
testcase_25 AC 55 ms
36,852 KB
testcase_26 AC 55 ms
36,980 KB
testcase_27 AC 55 ms
37,108 KB
testcase_28 AC 54 ms
36,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

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

public class Main {
	public static void main(String[] args) {
		BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
		try {
			String line = read.readLine() + read.readLine();

			int max = 0;
			int count = 0;
			for (int i = 0; i < line.length(); ++i) {
				if (line.charAt(i) == 'o') {
					++count;
					if (max < count) {
						max = count;
					}
				} else {
					count = 0;
				}
			}

			System.out.println(max);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
0