結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー kenkooookenkoooo
提出日時 2015-05-09 00:13:33
言語 Java19
(openjdk 21)
結果
WA  
実行時間 -
コード長 956 bytes
コンパイル時間 4,172 ms
コンパイル使用メモリ 76,032 KB
実行使用メモリ 59,072 KB
最終ジャッジ日時 2023-08-03 15:14:18
合計ジャッジ時間 13,487 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 155 ms
56,704 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 161 ms
56,956 KB
testcase_05 AC 161 ms
56,572 KB
testcase_06 AC 157 ms
56,872 KB
testcase_07 AC 159 ms
56,888 KB
testcase_08 AC 163 ms
56,664 KB
testcase_09 AC 159 ms
56,756 KB
testcase_10 AC 164 ms
56,600 KB
testcase_11 WA -
testcase_12 AC 161 ms
56,880 KB
testcase_13 AC 160 ms
56,852 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 159 ms
56,736 KB
testcase_17 AC 160 ms
57,032 KB
testcase_18 AC 158 ms
57,020 KB
testcase_19 AC 158 ms
56,964 KB
testcase_20 AC 156 ms
56,828 KB
testcase_21 AC 157 ms
57,004 KB
testcase_22 AC 161 ms
56,748 KB
testcase_23 AC 159 ms
56,620 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 154 ms
56,852 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 155 ms
56,732 KB
testcase_30 AC 159 ms
56,736 KB
testcase_31 AC 159 ms
56,768 KB
testcase_32 AC 161 ms
57,012 KB
testcase_33 AC 158 ms
56,900 KB
testcase_34 AC 156 ms
56,532 KB
testcase_35 AC 158 ms
56,944 KB
testcase_36 AC 161 ms
56,488 KB
testcase_37 AC 160 ms
56,896 KB
testcase_38 AC 159 ms
56,660 KB
testcase_39 AC 157 ms
56,932 KB
testcase_40 AC 161 ms
54,824 KB
testcase_41 AC 160 ms
56,720 KB
testcase_42 AC 160 ms
56,680 KB
testcase_43 AC 160 ms
56,796 KB
testcase_44 AC 159 ms
56,924 KB
testcase_45 AC 159 ms
56,548 KB
testcase_46 AC 160 ms
56,884 KB
testcase_47 WA -
testcase_48 AC 161 ms
56,808 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 i = 0; i + D < 42; i++) {
			char[] holidays = new char[42];
			for (int j = 0; j < i; j++) {
				if (string[j] == 'o') {
					holidays[j] = 'o';
				} else {
					holidays[j] = 'x';
				}
			}
			for (int j = i; j < i + D; j++) {
				holidays[j] = 'o';
			}
			for (int j = i + D; j < 42; j++) {
				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