#include <bits/stdc++.h>
using namespace std;
const int NMAX = 3e5;
int v[NMAX];
int main() {
int n;
cin >> n;
for(int i = 0; i < n; i++)
cin >> v[i];
sort(v, v + n);
int cnt1 = 0;
int i = 0;
while(i < n && v[i] == v[0]) {
i++;
cnt1++;
}
int cnt2 = 0;
while(i < n && v[i] == v[n - 1]) {
i++;
cnt2++;
}
cout << max(1LL * (cnt2 - 2) * (cnt2 - 1) / 2 * (cnt1 - 1), 0LL);
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
11 ms |
604 KB |
Output isn't correct |
4 |
Incorrect |
40 ms |
1500 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Incorrect |
9 ms |
476 KB |
Output isn't correct |
4 |
Incorrect |
27 ms |
604 KB |
Output isn't correct |
5 |
Incorrect |
54 ms |
1116 KB |
Output isn't correct |
6 |
Incorrect |
81 ms |
1448 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
5 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
7 |
Incorrect |
3 ms |
348 KB |
Output isn't correct |
8 |
Incorrect |
25 ms |
604 KB |
Output isn't correct |
9 |
Incorrect |
40 ms |
1172 KB |
Output isn't correct |
10 |
Incorrect |
81 ms |
1360 KB |
Output isn't correct |