結果
問題 |
No.204 ゴールデン・ウィーク(2)
|
ユーザー |
|
提出日時 | 2015-07-05 19:46:19 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 460 bytes |
コンパイル時間 | 1,194 ms |
コンパイル使用メモリ | 160,656 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-13 13:27:48 |
合計ジャッジ時間 | 2,355 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 WA * 15 |
ソースコード
#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){ m=max(m, solve(b | ((1 << d) - 1) << i)); } cout<<m<<endl; }