Submission #875354

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8753542023-11-19 08:27:261075508020060209tcCandies (JOI18_candies)C++14
100 / 100
487 ms35912 KiB
//#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]});
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...