結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー kenkooookenkoooo
提出日時 2015-05-08 22:48:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 158 ms / 1,000 ms
コード長 501 bytes
コンパイル時間 3,269 ms
コンパイル使用メモリ 73,568 KB
実行使用メモリ 58,688 KB
最終ジャッジ日時 2023-08-11 15:36:33
合計ジャッジ時間 9,081 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 157 ms
56,756 KB
testcase_01 AC 154 ms
56,760 KB
testcase_02 AC 154 ms
56,764 KB
testcase_03 AC 155 ms
56,516 KB
testcase_04 AC 156 ms
56,904 KB
testcase_05 AC 158 ms
56,628 KB
testcase_06 AC 154 ms
56,760 KB
testcase_07 AC 158 ms
56,740 KB
testcase_08 AC 156 ms
56,884 KB
testcase_09 AC 154 ms
56,496 KB
testcase_10 AC 152 ms
56,876 KB
testcase_11 AC 154 ms
58,688 KB
testcase_12 AC 152 ms
56,768 KB
testcase_13 AC 152 ms
56,680 KB
testcase_14 AC 157 ms
56,740 KB
testcase_15 AC 151 ms
56,768 KB
testcase_16 AC 152 ms
56,692 KB
testcase_17 AC 152 ms
56,644 KB
testcase_18 AC 151 ms
56,988 KB
testcase_19 AC 150 ms
57,228 KB
testcase_20 AC 151 ms
56,664 KB
testcase_21 AC 152 ms
56,768 KB
testcase_22 AC 153 ms
56,932 KB
testcase_23 AC 152 ms
56,888 KB
testcase_24 AC 152 ms
56,872 KB
testcase_25 AC 156 ms
56,932 KB
testcase_26 AC 155 ms
56,788 KB
testcase_27 AC 154 ms
56,776 KB
testcase_28 AC 154 ms
56,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] weeks = new String[2];
		for (int i = 0; i < weeks.length; i++) {
			weeks[i] = sc.next();
		}
		char[] all = ("x" + weeks[0] + weeks[1] + "x").toCharArray();
		int cnt = 0;
		int max = 0;
		for (int i = 0; i < all.length; i++) {
			if (all[i] == 'o') {
				cnt++;
			} else {
				max = Math.max(max, cnt);
				cnt = 0;
			}
		}
		System.out.println(max);

	}
}
0