結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー bambambambam
提出日時 2019-08-27 11:20:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 1,000 ms
コード長 877 bytes
コンパイル時間 2,859 ms
コンパイル使用メモリ 77,628 KB
実行使用メモリ 54,340 KB
最終ジャッジ日時 2024-04-26 16:36:14
合計ジャッジ時間 10,526 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
53,912 KB
testcase_01 AC 125 ms
54,160 KB
testcase_02 AC 125 ms
53,824 KB
testcase_03 AC 126 ms
54,084 KB
testcase_04 AC 124 ms
53,924 KB
testcase_05 AC 127 ms
54,172 KB
testcase_06 AC 126 ms
54,184 KB
testcase_07 AC 125 ms
53,976 KB
testcase_08 AC 120 ms
52,784 KB
testcase_09 AC 125 ms
54,224 KB
testcase_10 AC 124 ms
54,000 KB
testcase_11 AC 124 ms
53,884 KB
testcase_12 AC 113 ms
52,816 KB
testcase_13 AC 111 ms
52,752 KB
testcase_14 AC 122 ms
54,060 KB
testcase_15 AC 125 ms
54,104 KB
testcase_16 AC 125 ms
54,124 KB
testcase_17 AC 126 ms
54,204 KB
testcase_18 AC 126 ms
54,128 KB
testcase_19 AC 126 ms
53,948 KB
testcase_20 AC 125 ms
53,656 KB
testcase_21 AC 125 ms
54,032 KB
testcase_22 AC 125 ms
53,976 KB
testcase_23 AC 113 ms
52,672 KB
testcase_24 AC 114 ms
53,032 KB
testcase_25 AC 124 ms
54,000 KB
testcase_26 AC 125 ms
54,116 KB
testcase_27 AC 127 ms
53,824 KB
testcase_28 AC 124 ms
54,116 KB
testcase_29 AC 120 ms
53,080 KB
testcase_30 AC 120 ms
53,900 KB
testcase_31 AC 121 ms
54,340 KB
testcase_32 AC 122 ms
53,992 KB
testcase_33 AC 123 ms
54,068 KB
testcase_34 AC 113 ms
53,084 KB
testcase_35 AC 124 ms
54,068 KB
testcase_36 AC 123 ms
53,836 KB
testcase_37 AC 125 ms
54,188 KB
testcase_38 AC 127 ms
54,032 KB
testcase_39 AC 127 ms
53,968 KB
testcase_40 AC 125 ms
54,096 KB
testcase_41 AC 125 ms
53,784 KB
testcase_42 AC 111 ms
53,028 KB
testcase_43 AC 122 ms
54,312 KB
testcase_44 AC 124 ms
53,888 KB
testcase_45 AC 111 ms
53,016 KB
testcase_46 AC 123 ms
53,824 KB
testcase_47 AC 122 ms
53,956 KB
testcase_48 AC 123 ms
53,904 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