結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-07-05 19:48:46 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 493 bytes |
| コンパイル時間 | 1,364 ms |
| コンパイル使用メモリ | 160,140 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-13 13:27:51 |
| 合計ジャッジ時間 | 2,202 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 7 WA * 39 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
int solve(int a) {
int m = 0;
while(a > 0) {
int l = a&-a;
int b=a&~(a+l);
m=max(m,__builtin_popcount(b));
a^=b;
}
return m;
}
int main(){
int b = 0;
int d;cin>>d;
rep(i,2) {
string s;cin>>s;
rep(j, 7) {
b |= s[j] == 'o' ? 1 << (i * 7 + j) : 0;
}
}
int m=0;
rep(i, 14){
rep(j,d) {
int q=((1<<j)-1)<<i;
if(b&q)continue;
m=max(m, solve(b | q));
}
}
cout<<m<<endl;
}