結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー bambambambam
提出日時 2019-08-27 11:20:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 1,000 ms
コード長 877 bytes
コンパイル時間 3,207 ms
コンパイル使用メモリ 78,776 KB
実行使用メモリ 57,628 KB
最終ジャッジ日時 2023-08-09 00:37:21
合計ジャッジ時間 10,717 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
56,156 KB
testcase_01 AC 121 ms
55,868 KB
testcase_02 AC 121 ms
56,144 KB
testcase_03 AC 122 ms
56,088 KB
testcase_04 AC 124 ms
55,836 KB
testcase_05 AC 121 ms
55,816 KB
testcase_06 AC 121 ms
55,980 KB
testcase_07 AC 123 ms
56,184 KB
testcase_08 AC 125 ms
55,868 KB
testcase_09 AC 123 ms
55,844 KB
testcase_10 AC 124 ms
55,660 KB
testcase_11 AC 125 ms
57,628 KB
testcase_12 AC 123 ms
56,164 KB
testcase_13 AC 122 ms
56,468 KB
testcase_14 AC 122 ms
56,188 KB
testcase_15 AC 120 ms
56,040 KB
testcase_16 AC 123 ms
56,152 KB
testcase_17 AC 120 ms
56,300 KB
testcase_18 AC 123 ms
55,772 KB
testcase_19 AC 121 ms
56,372 KB
testcase_20 AC 123 ms
56,320 KB
testcase_21 AC 124 ms
55,800 KB
testcase_22 AC 121 ms
55,664 KB
testcase_23 AC 124 ms
55,548 KB
testcase_24 AC 120 ms
55,848 KB
testcase_25 AC 121 ms
55,960 KB
testcase_26 AC 120 ms
56,116 KB
testcase_27 AC 122 ms
56,032 KB
testcase_28 AC 122 ms
56,084 KB
testcase_29 AC 120 ms
56,048 KB
testcase_30 AC 123 ms
56,152 KB
testcase_31 AC 120 ms
55,984 KB
testcase_32 AC 123 ms
56,084 KB
testcase_33 AC 122 ms
54,012 KB
testcase_34 AC 122 ms
55,812 KB
testcase_35 AC 121 ms
55,756 KB
testcase_36 AC 120 ms
55,748 KB
testcase_37 AC 125 ms
55,920 KB
testcase_38 AC 123 ms
56,172 KB
testcase_39 AC 124 ms
56,008 KB
testcase_40 AC 121 ms
55,688 KB
testcase_41 AC 120 ms
56,340 KB
testcase_42 AC 121 ms
56,016 KB
testcase_43 AC 123 ms
56,088 KB
testcase_44 AC 119 ms
56,136 KB
testcase_45 AC 121 ms
55,408 KB
testcase_46 AC 123 ms
53,960 KB
testcase_47 AC 120 ms
56,172 KB
testcase_48 AC 123 ms
56,064 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