結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー nCk_cvnCk_cv
提出日時 2015-08-02 17:17:41
言語 Java19
(openjdk 21)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 849 bytes
コンパイル時間 5,030 ms
コンパイル使用メモリ 79,172 KB
実行使用メモリ 57,344 KB
最終ジャッジ日時 2023-08-05 20:23:26
合計ジャッジ時間 10,824 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
56,028 KB
testcase_01 AC 126 ms
56,060 KB
testcase_02 AC 120 ms
55,488 KB
testcase_03 AC 123 ms
55,572 KB
testcase_04 AC 121 ms
53,444 KB
testcase_05 AC 126 ms
55,552 KB
testcase_06 AC 124 ms
55,848 KB
testcase_07 AC 122 ms
55,592 KB
testcase_08 AC 122 ms
55,880 KB
testcase_09 AC 123 ms
57,344 KB
testcase_10 AC 118 ms
55,792 KB
testcase_11 AC 121 ms
55,656 KB
testcase_12 AC 122 ms
55,832 KB
testcase_13 AC 122 ms
56,176 KB
testcase_14 AC 120 ms
55,900 KB
testcase_15 AC 129 ms
55,628 KB
testcase_16 AC 126 ms
55,988 KB
testcase_17 AC 123 ms
55,856 KB
testcase_18 AC 127 ms
55,792 KB
testcase_19 AC 116 ms
55,744 KB
testcase_20 AC 127 ms
55,476 KB
testcase_21 AC 122 ms
55,944 KB
testcase_22 WA -
testcase_23 AC 122 ms
55,664 KB
testcase_24 AC 125 ms
55,524 KB
testcase_25 AC 122 ms
55,840 KB
testcase_26 AC 124 ms
55,640 KB
testcase_27 AC 122 ms
55,380 KB
testcase_28 AC 120 ms
55,716 KB
testcase_29 AC 118 ms
55,780 KB
testcase_30 AC 121 ms
55,732 KB
testcase_31 AC 118 ms
55,864 KB
testcase_32 AC 122 ms
55,548 KB
testcase_33 AC 129 ms
55,864 KB
testcase_34 AC 121 ms
55,672 KB
testcase_35 AC 116 ms
56,132 KB
testcase_36 AC 118 ms
55,748 KB
testcase_37 AC 113 ms
55,716 KB
testcase_38 AC 119 ms
55,508 KB
testcase_39 AC 126 ms
53,672 KB
testcase_40 AC 116 ms
55,932 KB
testcase_41 AC 121 ms
55,588 KB
testcase_42 AC 117 ms
55,828 KB
testcase_43 AC 122 ms
55,500 KB
testcase_44 AC 117 ms
55,480 KB
testcase_45 AC 120 ms
55,644 KB
testcase_46 AC 123 ms
55,720 KB
testcase_47 AC 123 ms
55,904 KB
testcase_48 AC 124 ms
55,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int d = sc.nextInt();
		boolean[] day = new boolean[42];
		char[] in = sc.next().toCharArray();
		for(int i = 0; i < 7; i++) {
			day[14 + i] = (in[i] == 'o')?true:false;
		}
		in = sc.next().toCharArray();
		for(int i = 0; i < 7; i++) {
			day[21 + i] = (in[i] == 'o')?true:false;
		}
		int max = 0;
		for(int i = 0; i < 42; i++) {
			boolean[] cp = Arrays.copyOf(day, day.length);
			for(int j = 0; j < d; j++) {
				if(i + j >= cp.length) break;
				if(cp[i + j]) break;
				cp[i + j] = true;
			}
			
			for(int j = 0; j < 42; j++) {
				if(!cp[j]) continue;
				for(int k = j; k < 42; k++) {
					if(!cp[k]) {
						max = Math.max(max, k - j);
						break;
					}
				}
			}
			
			
			
		}
		System.out.println(max);
		
		
	}
}
0