This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |