# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
94163 | AKaan37 | Nizin (COCI16_nizin) | C++17 | 115 ms | 66560 KiB |
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>
using namespace std;
typedef long long int lo;
typedef pair<int,int> PII;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define FOR for(lo i=1;i<=n;i++)
#define mid (start+end)/2
const lo mod = 1000000007;
const lo li = 100000001;
const lo inf = 1000000000;
const lo MAX = 1000000000000000000;
const lo MIN = -1000000000000000000;
const lo LOG = 30;
lo n,m,cev,a[li],oo,ama,kk,vis[li],gogo,nono;
//~ vector<lo> v;
int main(){
scanf("%lld",&n);
FOR{
scanf("%lld",&a[i]);
}
FOR{
if(vis[i]==1) continue;
while(a[i]!=a[n-i+1]){
if(a[i]>a[n-i+1]){
gogo++;
a[n-i+1]+=a[n-i+1-gogo];
vis[n-i+1-gogo]=1;
oo++;
}
if(a[i]<a[n-i+1]){
nono++;
a[i]+=a[i+nono];
vis[i+nono]=1;
oo++;
}
}
}
printf("%lld\n",oo);
return 0;
}
Compilation message (stderr)
# | 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... |
# | 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... |