답안 #857463

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
857463 2023-10-06T08:57:46 Z lbadea1000 W (RMI18_w) C++17
10 / 100
88 ms 3812 KB
#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 << 1LL * (cnt2 - 2) * (cnt2 - 1) / 2 * (cnt1 - 1);
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 428 KB Output is correct
3 Incorrect 14 ms 1012 KB Output isn't correct
4 Incorrect 41 ms 2388 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Incorrect 1 ms 348 KB Output isn't correct
3 Incorrect 8 ms 604 KB Output isn't correct
4 Incorrect 27 ms 1432 KB Output isn't correct
5 Incorrect 55 ms 2392 KB Output isn't correct
6 Incorrect 88 ms 3548 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 444 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 4 ms 348 KB Output isn't correct
8 Incorrect 27 ms 1372 KB Output isn't correct
9 Incorrect 41 ms 2136 KB Output isn't correct
10 Incorrect 88 ms 3812 KB Output isn't correct