Submission #592389

#TimeUsernameProblemLanguageResultExecution timeMemory
592389ngano_upat_naMountains (NOI20_mountains)C++17
64 / 100
2063 ms8156 KiB
#include "bits/stdc++.h" using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector<ll> v(n); for (auto &e:v) cin >> e; ll ans = 0; for (int i=1; i<n-1; i++) { ll l = 0, r = 0; for (int j=0; j<i; j++) { if (v[j] < v[i]) { l++; } } for (int j=i+1; j<n; j++) { if (v[i] > v[j]) { r++; } } l *= r; ans += l; } 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...