Submission #53948

#TimeUsernameProblemLanguageResultExecution timeMemory
53948Mahmoud_AdelBali Sculptures (APIO15_sculpture)C++14
0 / 100
3 ms640 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...