結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー nCk_cvnCk_cv
提出日時 2015-08-02 17:17:41
言語 Java21
(openjdk 21)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 849 bytes
コンパイル時間 2,838 ms
コンパイル使用メモリ 77,476 KB
実行使用メモリ 41,928 KB
最終ジャッジ日時 2024-04-23 16:55:25
合計ジャッジ時間 9,418 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
41,180 KB
testcase_01 AC 119 ms
41,584 KB
testcase_02 AC 105 ms
41,504 KB
testcase_03 AC 114 ms
41,596 KB
testcase_04 AC 105 ms
41,124 KB
testcase_05 AC 115 ms
41,324 KB
testcase_06 AC 109 ms
41,364 KB
testcase_07 AC 105 ms
41,928 KB
testcase_08 AC 108 ms
41,388 KB
testcase_09 AC 103 ms
41,352 KB
testcase_10 AC 97 ms
40,736 KB
testcase_11 AC 114 ms
41,680 KB
testcase_12 AC 115 ms
41,364 KB
testcase_13 AC 118 ms
41,072 KB
testcase_14 AC 114 ms
41,344 KB
testcase_15 AC 119 ms
41,428 KB
testcase_16 AC 113 ms
41,504 KB
testcase_17 AC 113 ms
41,256 KB
testcase_18 AC 112 ms
41,400 KB
testcase_19 AC 115 ms
39,824 KB
testcase_20 AC 118 ms
41,352 KB
testcase_21 AC 104 ms
41,248 KB
testcase_22 WA -
testcase_23 AC 114 ms
41,404 KB
testcase_24 AC 120 ms
41,288 KB
testcase_25 AC 102 ms
41,088 KB
testcase_26 AC 114 ms
41,348 KB
testcase_27 AC 111 ms
40,296 KB
testcase_28 AC 111 ms
40,136 KB
testcase_29 AC 104 ms
41,220 KB
testcase_30 AC 112 ms
40,860 KB
testcase_31 AC 111 ms
41,300 KB
testcase_32 AC 112 ms
41,240 KB
testcase_33 AC 114 ms
40,952 KB
testcase_34 AC 115 ms
41,108 KB
testcase_35 AC 116 ms
41,124 KB
testcase_36 AC 102 ms
41,580 KB
testcase_37 AC 117 ms
39,976 KB
testcase_38 AC 115 ms
41,272 KB
testcase_39 AC 105 ms
41,268 KB
testcase_40 AC 104 ms
41,380 KB
testcase_41 AC 98 ms
40,996 KB
testcase_42 AC 101 ms
41,680 KB
testcase_43 AC 102 ms
40,076 KB
testcase_44 AC 135 ms
41,324 KB
testcase_45 AC 136 ms
41,100 KB
testcase_46 AC 132 ms
41,428 KB
testcase_47 AC 112 ms
41,616 KB
testcase_48 AC 111 ms
41,304 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