# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
875354 | 1075508020060209tc | Candies (JOI18_candies) | C++14 | 487 ms | 35912 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.
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
#define int long long
int n;
int ar[500005];
int ps[2][500005];
set<pair<int,pair<int,int>>>stv[2];
set<pair<pair<int,int>,int>>st[2];
signed main()
{
cin.tie(0);
ios_base::sync_with_stdio(0);
cin>>n;
ar[0]=-1e16;ar[n+1]=-1e16;
for(int i=1;i<=n;i++){
cin>>ar[i];
}
ps[0][0]=ar[0];
for(int i=1;i<=n+1;i++){
ps[0][i]=ps[0][i-1];
ps[1][i]=ps[1][i-1];
ps[i%2][i]+=ar[i];
}
int ans=0;
for(int i=0;i<=n+1;i++){
stv[i%2].insert({ar[i],{i,i}});
st[i%2].insert({{i,i},ar[i]});
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |