#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Execution timed out |
2025 ms |
8256 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2040 ms |
3160 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2040 ms |
3160 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
32 ms |
424 KB |
Output is correct |
2 |
Correct |
32 ms |
424 KB |
Output is correct |
3 |
Correct |
31 ms |
424 KB |
Output is correct |
4 |
Correct |
30 ms |
424 KB |
Output is correct |
5 |
Correct |
34 ms |
344 KB |
Output is correct |
6 |
Correct |
37 ms |
600 KB |
Output is correct |
7 |
Correct |
32 ms |
360 KB |
Output is correct |
8 |
Correct |
30 ms |
360 KB |
Output is correct |
9 |
Correct |
29 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
32 ms |
424 KB |
Output is correct |
2 |
Correct |
32 ms |
424 KB |
Output is correct |
3 |
Correct |
31 ms |
424 KB |
Output is correct |
4 |
Correct |
30 ms |
424 KB |
Output is correct |
5 |
Correct |
34 ms |
344 KB |
Output is correct |
6 |
Correct |
37 ms |
600 KB |
Output is correct |
7 |
Correct |
32 ms |
360 KB |
Output is correct |
8 |
Correct |
30 ms |
360 KB |
Output is correct |
9 |
Correct |
29 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Execution timed out |
2021 ms |
600 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2040 ms |
3160 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Execution timed out |
2025 ms |
8256 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |