Submission #570209

#TimeUsernameProblemLanguageResultExecution timeMemory
570209juliocesar97Mountains (NOI20_mountains)C++14
64 / 100
2084 ms2516 KiB
#include <bits/stdc++.h> using namespace std; int main(){ long long n; long long cont1=0; long long cont2=0; long long ans2 = 0; cin>>n; long long v[n]; for(int i=0; i<n; i++){ cin>>v[i]; } for(int i=1; i<n; i++){ for(int j=0; j<i; j++){ if(v[i] > v[j]){ cont1 += 1; } } for(int k=n-1; k>i; k--){ if(v[i] > v[k]){ cont2 +=1; } } ans2 += (cont1*cont2); cont1 =0; cont2=0; } //cout<<"program compiled, output: "<<ans2; cout<<ans2; return 0; }
#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...