제출 #557118

#제출 시각아이디문제언어결과실행 시간메모리
557118donaldchuityMountains (NOI20_mountains)C++17
0 / 100
2091 ms1364 KiB
#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int h[n]; bool status = false; for (int i = 0; i < n; i++) { cin >> h[i]; if (i >= 1) if (h[i] < h[i-1]) status = true; } if (status == false) cout << "0\n"; else { int count = 0; for (int i = 0; i < n; i++) { for (int j = i+1; j < n; j++) { for (int k = j+1; k < n; k++) { if (h[i] < h[j] and h[j] > h[k]) count++; } } } cout << count << "\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...