結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー kenkooookenkoooo
提出日時 2015-05-09 00:13:33
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 956 bytes
コンパイル時間 3,984 ms
コンパイル使用メモリ 79,336 KB
実行使用メモリ 42,540 KB
最終ジャッジ日時 2024-04-21 13:27:02
合計ジャッジ時間 13,249 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 165 ms
42,056 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 164 ms
42,312 KB
testcase_05 AC 166 ms
42,320 KB
testcase_06 AC 162 ms
42,140 KB
testcase_07 AC 165 ms
42,032 KB
testcase_08 AC 157 ms
42,192 KB
testcase_09 AC 170 ms
42,152 KB
testcase_10 AC 175 ms
42,288 KB
testcase_11 WA -
testcase_12 AC 169 ms
42,148 KB
testcase_13 AC 166 ms
42,320 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 158 ms
42,380 KB
testcase_17 AC 155 ms
42,156 KB
testcase_18 AC 159 ms
42,404 KB
testcase_19 AC 171 ms
42,356 KB
testcase_20 AC 162 ms
42,308 KB
testcase_21 AC 156 ms
42,424 KB
testcase_22 AC 167 ms
42,516 KB
testcase_23 AC 163 ms
42,480 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 162 ms
42,008 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 164 ms
42,124 KB
testcase_30 AC 165 ms
42,376 KB
testcase_31 AC 159 ms
42,264 KB
testcase_32 AC 162 ms
42,204 KB
testcase_33 AC 159 ms
42,540 KB
testcase_34 AC 167 ms
42,252 KB
testcase_35 AC 161 ms
42,312 KB
testcase_36 AC 162 ms
42,080 KB
testcase_37 AC 161 ms
42,372 KB
testcase_38 AC 163 ms
42,372 KB
testcase_39 AC 161 ms
42,008 KB
testcase_40 AC 167 ms
42,332 KB
testcase_41 AC 165 ms
42,316 KB
testcase_42 AC 169 ms
42,312 KB
testcase_43 AC 169 ms
42,236 KB
testcase_44 AC 167 ms
42,344 KB
testcase_45 AC 168 ms
42,120 KB
testcase_46 AC 167 ms
42,492 KB
testcase_47 WA -
testcase_48 AC 169 ms
42,276 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