#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define s second
#define f first
#define mod int(1e9+7)
#define clr(i, j) memset(i, j, sizeof i)
#define opt ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL);
using namespace std;
typedef long long ll;
typedef unsigned long long ull ;
typedef long double ld;
typedef vector<ll> vi;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef pair<ll, ll> pll;
//--------------------------
int main()
{
ll n, x, y;
cin >> n >> x >> y;
ll a[n];
ll sum = 0, cur = 0;
for(int i=0; i<n; i++)
{
cin >> a[i];
sum += a[i];
}
ll mn = 1e18;
for(int i=0; i<n; i++)
{
sum -= a[i];
cur += a[i];
mn = min(mn, (cur|sum)) ;
}
cout << mn << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
460 KB |
Output is correct |
2 |
Incorrect |
2 ms |
640 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
640 KB |
Output is correct |
2 |
Incorrect |
2 ms |
640 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
640 KB |
Output is correct |
2 |
Incorrect |
2 ms |
640 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
640 KB |
Output is correct |
2 |
Incorrect |
2 ms |
640 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |