結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー kenkooookenkoooo
提出日時 2015-05-09 00:34:49
言語 Java21
(openjdk 21)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,108 bytes
コンパイル時間 5,329 ms
コンパイル使用メモリ 75,784 KB
実行使用メモリ 58,652 KB
最終ジャッジ日時 2023-08-05 20:23:07
合計ジャッジ時間 15,398 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 158 ms
56,912 KB
testcase_01 AC 159 ms
56,816 KB
testcase_02 AC 157 ms
57,024 KB
testcase_03 AC 157 ms
56,808 KB
testcase_04 AC 158 ms
56,836 KB
testcase_05 AC 156 ms
56,884 KB
testcase_06 AC 158 ms
56,632 KB
testcase_07 AC 159 ms
56,836 KB
testcase_08 AC 161 ms
54,948 KB
testcase_09 AC 161 ms
56,816 KB
testcase_10 AC 158 ms
56,632 KB
testcase_11 AC 158 ms
56,848 KB
testcase_12 AC 158 ms
56,840 KB
testcase_13 AC 158 ms
56,812 KB
testcase_14 AC 155 ms
56,816 KB
testcase_15 AC 159 ms
57,156 KB
testcase_16 AC 157 ms
56,540 KB
testcase_17 AC 159 ms
56,876 KB
testcase_18 AC 159 ms
57,024 KB
testcase_19 AC 159 ms
56,828 KB
testcase_20 AC 155 ms
56,576 KB
testcase_21 AC 157 ms
58,652 KB
testcase_22 WA -
testcase_23 AC 155 ms
56,848 KB
testcase_24 AC 157 ms
56,672 KB
testcase_25 AC 170 ms
57,044 KB
testcase_26 AC 155 ms
56,664 KB
testcase_27 AC 155 ms
57,220 KB
testcase_28 AC 153 ms
56,836 KB
testcase_29 AC 155 ms
56,776 KB
testcase_30 AC 157 ms
56,816 KB
testcase_31 AC 157 ms
56,680 KB
testcase_32 AC 155 ms
56,652 KB
testcase_33 AC 157 ms
57,128 KB
testcase_34 AC 155 ms
56,724 KB
testcase_35 AC 155 ms
56,768 KB
testcase_36 AC 154 ms
56,924 KB
testcase_37 AC 154 ms
56,588 KB
testcase_38 AC 156 ms
57,168 KB
testcase_39 AC 159 ms
56,876 KB
testcase_40 AC 157 ms
57,124 KB
testcase_41 AC 154 ms
56,888 KB
testcase_42 AC 158 ms
56,816 KB
testcase_43 AC 157 ms
56,856 KB
testcase_44 AC 160 ms
56,892 KB
testcase_45 AC 160 ms
56,784 KB
testcase_46 AC 156 ms
56,848 KB
testcase_47 AC 159 ms
56,676 KB
testcase_48 AC 157 ms
56,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class CopyOfMain {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int D = sc.nextInt();
		char[] string = ("xxxxxxxxxxxxxx" + sc.next() + sc.next() + "xxxxxxxxxxxxxx").toCharArray();
		sc.close();

		int max = 0;
		for (int day = 0; day <= D; day++) {
			slide: for (int i = 0; i + day < 42; i++) {
				char[] holidays = new char[42];
				for (int j = 0; j < 42; j++) {
					if (j < i) {
						if (string[j] == 'o') {
							holidays[j] = 'o';
						} else {
							holidays[j] = 'x';
						}
					} else if (j < i + day) {
						if (string[j] == 'o') {
							continue slide;
						} else {
							holidays[j] = 'o';
						}
					} else {
						if (string[j] == 'o') {
							holidays[j] = 'o';
						} else {
							holidays[j] = 'x';
						}
					}

				}

				int cnt = 0;
				for (int j = 0; j < holidays.length; j++) {
					if (holidays[j] == 'o') {
						cnt++;
					}
					if (holidays[j] == 'x' || j == holidays.length - 1) {
						max = Math.max(max, cnt);
						cnt = 0;
					}
				}
			}
		}

		System.out.println(max);
	}
}
0