Submission #857467

# Submission time Handle Problem Language Result Execution time Memory
857467 2023-10-06T09:00:51 Z lbadea1000 W (RMI18_w) C++17
10 / 100
85 ms 1428 KB
#include <bits/stdc++.h>

using namespace std;

const int NMAX = 3e5 + 5;
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;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 600 KB Output is correct
3 Incorrect 11 ms 560 KB Output isn't correct
4 Incorrect 41 ms 1372 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Incorrect 1 ms 348 KB Output isn't correct
3 Incorrect 8 ms 480 KB Output isn't correct
4 Incorrect 28 ms 832 KB Output isn't correct
5 Incorrect 54 ms 1196 KB Output isn't correct
6 Incorrect 83 ms 1428 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 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 344 KB Output isn't correct
6 Incorrect 1 ms 452 KB Output isn't correct
7 Incorrect 5 ms 344 KB Output isn't correct
8 Incorrect 24 ms 604 KB Output isn't correct
9 Incorrect 41 ms 1192 KB Output isn't correct
10 Incorrect 85 ms 1372 KB Output isn't correct