# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
570228 | elpro123 | Mountains (NOI20_mountains) | C++14 | 2090 ms | 2516 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main(){
long n;
cin>>n;
long heigh[n];
for(long i=0; i<n; i++){
cin>>heigh[i];
}
long cont=0;
/*
for(long i=0; i<n-2; i++){
for(long j=i+1; j<n-1; j++){
for(long k=j+1; k<n; k++){
cout<<heigh[i]<<" "<<heigh[j]<<" "<<heigh[k]<<"\n";
if(heigh[i]<heigh[j] and heigh[k]<heigh[j]){
cont++;
}
}
}
}
*/
long aux1=0, aux2=0, total=0;
for(long i=1; i<n-1; i++){
for(long j=i-1; j>=0; j--){
if(heigh[j]<heigh[i]){
aux1++;
}
}
for(long k=i+1; k<n; k++){
if(heigh[k]<heigh[i]){
aux2++;
}
}
total = total + (aux1*aux2);
aux1=0;
aux2=0;
}
cout<<total<<"\n";
return 0;
}
컴파일 시 표준 에러 (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... |