# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
570199 | Osplei | Mountains (NOI20_mountains) | C++17 | 2090 ms | 4504 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.
#include <bits/stdc++.h>
using namespace std;
vector <long long int> v;
int main() {
long long int n, a, c=0, p, md=0, mi=0;
cin >> n;
for (long long int i=0; i<n; i++){
cin >> a;
v.push_back(a);
}
for (long long int y=1; y<n-1; y++){
p=y;
for (int i=y-1; i>=0; i--){
if (v[i]<v[y]) mi++;
}
for (int i=y+1; i<n; i++){
if (v[i]<v[y]) md++;
}
c+=mi*md;
mi=0;
md=0;
}
cout << c;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |