Submission #570205

#TimeUsernameProblemLanguageResultExecution timeMemory
570205Santos_RiveraMountains (NOI20_mountains)C++14
64 / 100
2078 ms2728 KiB
#include<bits/stdc++.h> using namespace std; int main(){ long long n,x,ci=0,cd=0,cont=0; cin>>n; vector<long long> v; v.reserve(n); for(int i=0;i<n;i++){ cin>>x; v.push_back(x); } for(int i=1;i<n-1;i++){ ci=0;cd=0; for(int j=0;j<i;j++){ if(v[j]<v[i]){ ci++; } } for(int k=i+1;k<n;k++){ if(v[k]<v[i]){ cd++; } } cont+=ci*cd; } cout<<cont<<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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...