結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー bambambambam
提出日時 2019-08-27 11:15:32
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 876 bytes
コンパイル時間 2,123 ms
コンパイル使用メモリ 78,052 KB
実行使用メモリ 41,472 KB
最終ジャッジ日時 2024-04-26 16:29:29
合計ジャッジ時間 9,309 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
41,240 KB
testcase_01 AC 121 ms
41,428 KB
testcase_02 AC 123 ms
41,440 KB
testcase_03 AC 117 ms
39,932 KB
testcase_04 AC 118 ms
41,044 KB
testcase_05 AC 119 ms
40,344 KB
testcase_06 AC 108 ms
40,100 KB
testcase_07 AC 117 ms
40,980 KB
testcase_08 AC 120 ms
41,100 KB
testcase_09 AC 119 ms
41,036 KB
testcase_10 AC 117 ms
41,156 KB
testcase_11 AC 121 ms
41,184 KB
testcase_12 AC 107 ms
40,428 KB
testcase_13 AC 109 ms
40,228 KB
testcase_14 AC 119 ms
40,952 KB
testcase_15 AC 108 ms
40,312 KB
testcase_16 AC 105 ms
40,128 KB
testcase_17 AC 122 ms
41,344 KB
testcase_18 AC 121 ms
41,052 KB
testcase_19 AC 120 ms
41,248 KB
testcase_20 AC 119 ms
41,100 KB
testcase_21 AC 120 ms
41,356 KB
testcase_22 WA -
testcase_23 AC 117 ms
41,120 KB
testcase_24 AC 121 ms
41,204 KB
testcase_25 AC 123 ms
41,164 KB
testcase_26 AC 133 ms
41,104 KB
testcase_27 AC 109 ms
40,164 KB
testcase_28 AC 118 ms
41,056 KB
testcase_29 AC 119 ms
39,968 KB
testcase_30 AC 117 ms
41,472 KB
testcase_31 AC 123 ms
41,312 KB
testcase_32 AC 124 ms
41,116 KB
testcase_33 AC 118 ms
41,160 KB
testcase_34 AC 120 ms
41,412 KB
testcase_35 AC 112 ms
40,536 KB
testcase_36 AC 122 ms
41,172 KB
testcase_37 AC 124 ms
41,024 KB
testcase_38 AC 126 ms
41,088 KB
testcase_39 AC 118 ms
40,948 KB
testcase_40 AC 121 ms
41,408 KB
testcase_41 AC 122 ms
41,176 KB
testcase_42 AC 108 ms
39,916 KB
testcase_43 AC 118 ms
41,440 KB
testcase_44 AC 116 ms
41,412 KB
testcase_45 AC 121 ms
41,208 KB
testcase_46 AC 121 ms
41,032 KB
testcase_47 AC 121 ms
41,316 KB
testcase_48 AC 123 ms
41,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int d = sc.nextInt();
		char s1[] = sc.next().toCharArray();
		char s2[] = sc.next().toCharArray();
		char cal[] = new char[42];
		Arrays.fill(cal, 'x');
		for (int i = 14; i < 21; i++) {
			cal[i] = s1[i - 14];
		}
		for (int i = 21; i < 28; i++) {
			cal[i] = s2[i - 21];
		}
		char[] tmp;
		int cnt, max = 0;
		for (int i = 0; i < 42 - d; i++) {
			tmp = Arrays.copyOf(cal, cal.length);
			cnt = 0;
			for (int j = i; j < d + i; j++) {
				if(tmp[j] == 'o') {
					break;
				}
				tmp[j] = 'o';
			}
			for (int j = 0; j < 42; j++) {
				if (tmp[j] == 'o') {
					cnt++;
					max = Math.max(max, cnt);
				} else {
					cnt = 0;
				}
			}
		}
		System.out.println(max);
	}
}
0