結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー tkzw_21
提出日時 2015-05-08 22:50:38
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 444 bytes
コンパイル時間 673 ms
コンパイル使用メモリ 69,548 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-13 11:39:19
合計ジャッジ時間 1,923 ms
ジャッジサーバーID
(参考情報)
judge5 / 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 main(void){
	string s1,s2;
	int d;
	cin >> d;
	cin >> s1 >> s2;
	s1 += s2;

	int ret = 0;
	for(int i=0;i<(1<<14);i++){
		int a=0;
		if(__builtin_popcount(i) != d)continue;
		for(int j=0;j<14;j++){
			if(s1[j] == 'o' || (1<<j)&i)a++;
			else a=0;
			ret = max(a,ret);
		}
	}
	cout << ret << endl;
	return 0;
}
0