이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*
y = station
x and y = reciving stations
order = x.y.z
x and z shorter than mountain y
*/
#include <bits/stdc++.h>
using namespace std;
int main(){
long long n;
long long cont1=0;
long long cont2=0;
long long ans1=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; k>i; k--){
if(v[i] > v[k]){
cont2 +=1;
ans1 = cont1*cont2;}
}
ans2 += ans1;
cont1 =0;
cont2=0;
ans1=0;
}
//cout<<"program compiled, output: "<<ans2;
cout<<ans2;
return 0;
}
# | 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... |