题目链接:Codeforces 631A Interview
题意:给你
n
个数,让你找到一个区间
AC 代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#define CLR(a, b) memset(a, (b), sizeof(a))
#define ll o<<1
#define rr o<<1|1
using namespace std;
typedef long long LL;
const int MAXN = 1e5+10;
const int MAXM = 2*1e6+10;
const int INF = 0x3f3f3f3f;
const double eps = 1e-4;
const int MOD = 1e9+7;
int main()
{
int n, v; cin >> n;
LL ans1 = 0, ans2 = 0;
for(int i = 0; i < n; i++) cin >> v, ans1 |= v;
for(int i = 0; i < n; i++) cin >> v, ans2 |= v;
cout << ans1 + ans2 << endl;
return 0;
}