結果

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

ソースコード

diff #

#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+1) {
int q=((1<<j)-1)<<i;
if(b&q)continue;
m=max(m, solve(b | q));
}
}
cout<<m<<endl;
}
0