結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー GrenacheGrenache
提出日時 2015-05-08 23:33:17
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 824 bytes
コンパイル時間 2,016 ms
コンパイル使用メモリ 79,384 KB
実行使用メモリ 56,436 KB
最終ジャッジ日時 2024-04-21 13:18:43
合計ジャッジ時間 9,920 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
42,168 KB
testcase_01 WA -
testcase_02 AC 129 ms
42,028 KB
testcase_03 AC 134 ms
42,256 KB
testcase_04 AC 144 ms
42,520 KB
testcase_05 AC 121 ms
42,524 KB
testcase_06 AC 138 ms
42,456 KB
testcase_07 WA -
testcase_08 AC 137 ms
42,484 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 140 ms
42,404 KB
testcase_12 AC 128 ms
42,140 KB
testcase_13 WA -
testcase_14 AC 125 ms
41,948 KB
testcase_15 WA -
testcase_16 AC 136 ms
42,356 KB
testcase_17 AC 126 ms
42,068 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 126 ms
41,936 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 133 ms
42,596 KB
testcase_24 WA -
testcase_25 AC 131 ms
42,488 KB
testcase_26 AC 142 ms
42,052 KB
testcase_27 AC 124 ms
42,552 KB
testcase_28 WA -
testcase_29 AC 133 ms
42,068 KB
testcase_30 AC 123 ms
42,496 KB
testcase_31 AC 128 ms
42,180 KB
testcase_32 AC 121 ms
42,180 KB
testcase_33 WA -
testcase_34 AC 122 ms
42,192 KB
testcase_35 AC 129 ms
42,032 KB
testcase_36 AC 139 ms
42,284 KB
testcase_37 AC 138 ms
42,696 KB
testcase_38 AC 133 ms
42,652 KB
testcase_39 AC 127 ms
41,980 KB
testcase_40 AC 127 ms
42,212 KB
testcase_41 AC 130 ms
42,512 KB
testcase_42 WA -
testcase_43 AC 135 ms
41,964 KB
testcase_44 AC 131 ms
41,460 KB
testcase_45 AC 126 ms
42,536 KB
testcase_46 AC 120 ms
42,148 KB
testcase_47 WA -
testcase_48 AC 131 ms
42,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder150508;
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int d = sc.nextInt();
		String c = "xxxxxxx" + sc.next() + sc.next() + "xxxxxxx";
		StringBuffer[] cc = new StringBuffer[c.length()];

		for (int i = 0; i < c.length(); i++) {
			cc[i] = new StringBuffer(c);
			for (int j = i; j < i + d && j < cc[i].length(); j++) {
				if (cc[i].charAt(j) == 'x') {
					cc[i].setCharAt(j, 'o');
				} else {
					break;
				}
			}
		}
		
		int max = 0;
		for (int j = 0; j < cc.length; j++) {
			int count = 0;
			for (int i = 0; i < cc[j].length(); i++) {
				if (cc[j].charAt(i) == 'o') {
					count++;
					max = Math.max(max, count);
				} else {
					count = 0;
				}
			}
		}

		System.out.println(max);

		sc.close();
	}
}
0