Submission #570159

#TimeUsernameProblemLanguageResultExecution timeMemory
570159elpro123Mountains (NOI20_mountains)C++14
36 / 100
2077 ms2516 KiB
#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++; } } } } cout<<cont<<"\n"; 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...