結果

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

ソースコード

diff #

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<ctime>
#include<complex>
#include<functional>
#include<climits>
#include<cassert>
#include<iterator>
using namespace std;
string s;
int solve(){
	int countt = 0;
	int maxt = 0;
	for (int i = 0; i < s.size(); i++){
		if (s[i] == 'o'){
			countt++;
			maxt = max(maxt, countt);
		}
		else{
			countt = 0;
		}
	}
	return maxt;
}
char ss = 'o';
int main(){
	int d;
	cin >> d;
	cin >> s;
	string t;
	cin >> t;
	s += t;
	string tmp = s;
	int ans = 0;
	for (int i = 0; i < s.size(); i++){
		s = tmp;
		for (int j = i; j < s.size() && j < i + d; j++){
			s[j] = ss;
		}
			ans = max(ans, solve());
	}
	cout << ans << endl;
	return 0;
}
0