Submission #851417

#TimeUsernameProblemLanguageResultExecution timeMemory
851417NamPEMountains (NOI20_mountains)C++17
36 / 100
2040 ms8256 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; cin >> n; vector<ll> h(n); for(ll& i : h) { cin >> i; } ll ans = 0; for(ll i = 0; i < n; i++) { for(ll j = i + 1; j < n; j++) { for(ll k = j + 1; k < n; k++) { if(h[i] < h[j] && h[k] < h[j]) { ans++; } } } } cout << ans; }
#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...