結果
| 問題 |
No.2071 Shift and OR
|
| コンテスト | |
| ユーザー |
keisuke6
|
| 提出日時 | 2022-09-16 21:27:36 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 498 bytes |
| コンパイル時間 | 2,584 ms |
| コンパイル使用メモリ | 198,220 KB |
| 最終ジャッジ日時 | 2025-02-07 06:06:25 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 MLE * 7 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int N;
cin>>N;
vector<vector<int>> dp(N+1,vector<int>(70000));
dp[0][0] = 1;
vector<int> S(N);
for(int i=0;i<N;i++) cin>>S[i];
for(int i=0;i<N;i++)for(int j=0;j<69990;j++){
if(!dp[i][j]) continue;
for(int k=0;k<16;k++){
dp[i+1][j|S[i]] = 1;
S[i] = S[i]/2+(1<<15)*(S[i]%2);
}
}
for(int i=68000;i>=0;i--)if(dp[N][i]){
cout<<i<<endl;
return 0;
}
}
keisuke6