結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー ぴろずぴろず
提出日時 2015-05-08 23:23:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 1,000 ms
コード長 705 bytes
コンパイル時間 2,309 ms
コンパイル使用メモリ 72,076 KB
実行使用メモリ 56,424 KB
最終ジャッジ日時 2023-08-25 23:35:59
合計ジャッジ時間 9,739 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,804 KB
testcase_01 AC 121 ms
55,928 KB
testcase_02 AC 122 ms
53,712 KB
testcase_03 AC 122 ms
55,716 KB
testcase_04 AC 122 ms
55,884 KB
testcase_05 AC 121 ms
55,688 KB
testcase_06 AC 122 ms
55,824 KB
testcase_07 AC 122 ms
55,872 KB
testcase_08 AC 123 ms
56,024 KB
testcase_09 AC 122 ms
55,756 KB
testcase_10 AC 122 ms
55,748 KB
testcase_11 AC 122 ms
56,276 KB
testcase_12 AC 122 ms
56,216 KB
testcase_13 AC 124 ms
56,088 KB
testcase_14 AC 123 ms
55,816 KB
testcase_15 AC 122 ms
55,988 KB
testcase_16 AC 122 ms
56,172 KB
testcase_17 AC 123 ms
56,424 KB
testcase_18 AC 121 ms
55,784 KB
testcase_19 AC 123 ms
55,700 KB
testcase_20 AC 122 ms
55,740 KB
testcase_21 AC 123 ms
55,876 KB
testcase_22 AC 121 ms
56,032 KB
testcase_23 AC 123 ms
56,264 KB
testcase_24 AC 121 ms
55,968 KB
testcase_25 AC 121 ms
55,936 KB
testcase_26 AC 122 ms
55,708 KB
testcase_27 AC 122 ms
55,996 KB
testcase_28 AC 123 ms
55,700 KB
testcase_29 AC 123 ms
55,924 KB
testcase_30 AC 120 ms
56,196 KB
testcase_31 AC 120 ms
55,860 KB
testcase_32 AC 120 ms
55,964 KB
testcase_33 AC 120 ms
55,860 KB
testcase_34 AC 123 ms
55,548 KB
testcase_35 AC 121 ms
55,444 KB
testcase_36 AC 122 ms
55,920 KB
testcase_37 AC 121 ms
55,796 KB
testcase_38 AC 122 ms
55,720 KB
testcase_39 AC 122 ms
55,868 KB
testcase_40 AC 121 ms
55,676 KB
testcase_41 AC 119 ms
55,932 KB
testcase_42 AC 121 ms
55,912 KB
testcase_43 AC 121 ms
55,868 KB
testcase_44 AC 121 ms
55,824 KB
testcase_45 AC 121 ms
55,864 KB
testcase_46 AC 120 ms
55,752 KB
testcase_47 AC 122 ms
55,704 KB
testcase_48 AC 122 ms
55,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no204a;

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int d = sc.nextInt();
		char[] c = new char[100];
		for(int i=0;i<2;i++) {
			char[] s = sc.next().toCharArray();
			for(int j=0;j<7;j++) {
				c[20+i*7+j] = s[j];
			}
		}
		int max = 0;
		for(int k=0;k<100;k++) {
			int now = 0;
			int yukyuu = 0;
			for(int i=0;i<100;i++) {
				if (i == k) {
					yukyuu = d;
				}
				if (c[i] == 'o') {
					now++;
					max = Math.max(max, now);
					yukyuu = 0;
				}else if(yukyuu > 0){
					now++;
					max = Math.max(max, now);
					yukyuu--;
				}else{
					now = 0;
				}
			}
		}
		System.out.println(max);
	}
}
0