結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー ぴろず
提出日時 2015-05-08 22:25:56
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 698 bytes
コンパイル時間 2,166 ms
コンパイル使用メモリ 74,904 KB
実行使用メモリ 56,108 KB
最終ジャッジ日時 2024-10-13 11:26:42
合計ジャッジ時間 8,841 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

package no204;

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[14];
		for(int i=0;i<2;i++) {
			char[] s = sc.next().toCharArray();
			for(int j=0;j<7;j++) {
				c[i*7+j] = s[j];
			}
		}
		int max = 0;
		for(int k=0;k<14;k++) {
			int now = 0;
			int yukyuu = 0;
			for(int i=0;i<14;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