結果

問題 No.204 ゴールデン・ウィーク(2)
コンテスト
ユーザー Lepton_s
提出日時 2015-05-08 22:43:23
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 883 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 729 ms
コンパイル使用メモリ 104,028 KB
実行使用メモリ 13,056 KB
最終ジャッジ日時 2026-04-30 21:13:13
合計ジャッジ時間 6,526 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 3 WA * 3 RE * 8 TLE * 1 -- * 31
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<25;
typedef pair<int,int> P;
typedef long long ll;
typedef unsigned long long ull;


int main(){
	int D;
	string u, s, t;
	int res = 0, cnt = 0;
	cin>>D>>s>>t;
	u = s+t;
	for(int j = 0; j < u.size(); j++){
		s = u;
		for(int k = j; k < j+D; k++){
			if(s[k]=='o') break;
			s[k] = 'o';
		}
		for(int i = 0; i < s.size(); i++){
			if(s[i]=='o') cnt++;
			else cnt = 0;
			res = max(res, cnt);
		}
	}
	cout<<res<<endl;
	
	return 0;
}
0