Submission #570158

#TimeUsernameProblemLanguageResultExecution timeMemory
570158kamilamartinezMountains (NOI20_mountains)C++14
64 / 100
2083 ms2644 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, i, cont=0, a, b, j; cin >> n; ll xd[n]; for(i=0;i<n;i++) { cin >> xd[i]; } for(i=1;i<n-1;i++) { a=0; b=0; for(j=0;j<i;j++) { if(xd[j]<xd[i]) a++; } for(j=i+1;j<n;j++) { if(xd[j]<xd[i]) b++; } cont+=a*b; } cout << cont << endl; 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...