結果

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <map>
#include <cmath>
#include <algorithm>
#include <vector>

using namespace std;

int ret = 0;
void dfs(int n,int d,string& s1,int renkyu){
	if(n == 14){
		ret = max(ret,renkyu);
		return;
	}
	ret = max(ret,renkyu);
	if(s1[n] == 'o')dfs(n+1,d,s1,renkyu+1);
	else{
		if(d>0)dfs(n+1,d-1,s1,renkyu+1);
		dfs(n+1,d,s1,0);
	}
	return;
}

int main(void){
	string s1,s2;
	int n;
	cin >> n;
	cin >> s1 >> s2;
	s1 += s2;

	dfs(0,n,s1,0);
	cout <<ret << endl;

	return 0;
}
0