結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー dorakazu8134
提出日時 2015-08-16 19:36:00
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 479 bytes
コンパイル時間 476 ms
コンパイル使用メモリ 56,796 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-13 13:33:50
合計ジャッジ時間 1,713 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
using namespace std;
int main(){
	int d;
	string s, t;
	cin >> d >> s >> t;
	s =  s + t ;
	string sr = s;
	int ans = 0;
	for (int i = 0; i < sr.size(); i++){
		sr = s;
		for (int j = 0; j < d && i + j < sr.size(); j++){
			if (sr[i + j] == 'o') break;
			sr[i + j] = 'o';
		}
		int cnt = 0;
		for (int j = 0; j < s.size(); j++){
			if (sr[j] == 'o')cnt++;
			else cnt = 0;
			if (cnt > ans) ans = cnt;
		}
	}
	cout << ans << endl;
	return 0;
}
0