結果
問題 |
No.204 ゴールデン・ウィーク(2)
|
ユーザー |
|
提出日時 | 2015-07-05 19:45:31 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 444 bytes |
コンパイル時間 | 1,336 ms |
コンパイル使用メモリ | 158,728 KB |
実行使用メモリ | 13,696 KB |
最終ジャッジ日時 | 2024-10-13 13:27:46 |
合計ジャッジ時間 | 5,810 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | TLE * 1 -- * 45 |
ソースコード
#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 b=a&~(a+1); 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; }