結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー uafr_csuafr_cs
提出日時 2015-06-20 01:37:10
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,143 bytes
コンパイル時間 2,478 ms
コンパイル使用メモリ 77,724 KB
実行使用メモリ 41,540 KB
最終ジャッジ日時 2024-04-21 14:39:24
合計ジャッジ時間 8,566 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
41,136 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 99 ms
40,036 KB
testcase_05 AC 100 ms
40,028 KB
testcase_06 AC 110 ms
41,264 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 102 ms
40,496 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 114 ms
40,844 KB
testcase_17 AC 112 ms
41,092 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 116 ms
41,272 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 116 ms
41,364 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 113 ms
41,188 KB
testcase_30 AC 112 ms
41,028 KB
testcase_31 AC 108 ms
39,932 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 103 ms
40,240 KB
testcase_35 AC 112 ms
41,108 KB
testcase_36 AC 111 ms
41,212 KB
testcase_37 AC 118 ms
41,372 KB
testcase_38 AC 116 ms
41,320 KB
testcase_39 WA -
testcase_40 AC 101 ms
40,236 KB
testcase_41 AC 100 ms
40,088 KB
testcase_42 WA -
testcase_43 AC 102 ms
40,260 KB
testcase_44 AC 97 ms
39,648 KB
testcase_45 AC 105 ms
40,272 KB
testcase_46 AC 110 ms
41,140 KB
testcase_47 WA -
testcase_48 AC 108 ms
40,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main {
	
	public static final int SIZE = 14;
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		final int D = sc.nextInt();
		
		boolean[] days = new boolean[SIZE];
		for(int i = 0; i < 2; i++){
			char[] inputs = sc.next().toCharArray();
			
			for(int j = 0; j < SIZE / 2; j++){
				days[i * (SIZE / 2) + j] = inputs[j] == 'o';
			}
		}
		
		int max = 0;
		for(int d = 0; d <= SIZE - D; d++){
			boolean[] new_days = new boolean[SIZE];
			System.arraycopy(days, 0, new_days, 0, SIZE);
			
			for(int i = 0; i < D; i++){
				new_days[d + i] = true;
			}
			
			int prev = -1;
			for(int cur = 0; cur < SIZE; cur++){
				if(!new_days[cur] && prev >= 0){
					max = Math.max(max, cur - prev);
					prev = -1;
				}else if(new_days[cur] && prev < 0){
					prev = cur;
				}
			}
			
			if(prev >= 0){
				max = Math.max(max, SIZE - prev);
			}
		}
	
		System.out.println(max);
	}
}
0