提出 #16424435


ソースコード 拡げる

#include <iostream>
#include <vector>
using i64 = long long;

int main() {
    int n;
    std::cin >> n;
    std::vector<int> a(n);
    for (auto &e : a) std::cin >> e;

    int ret = 0;
    for (int i = 0; i < n; i++) for (int j = 0; j < i; j++) for (int k = 0; k < j; k++) {
        if (a[i] == a[j] || a[j] == a[k] || a[k] == a[i]) continue;
        if (a[i] + a[j] > a[k] && a[j] + a[k] > a[i] && a[k] + a[i] > a[j]) ret++;
    }

    std::cout << ret << std::endl;

    return 0;
}

提出情報

提出日時
問題 B - Making Triangle
ユーザ CharlotteL
言語 C++ (GCC 9.2.1)
得点 200
コード長 507 Byte
結果 AC
実行時間 6 ms
メモリ 3616 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 4
AC × 23
セット名 テストケース
Sample s1.txt, s2.txt, s3.txt, s4.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, s1.txt, s2.txt, s3.txt, s4.txt
ケース名 結果 実行時間 メモリ
01.txt AC 6 ms 3608 KiB
02.txt AC 2 ms 3576 KiB
03.txt AC 3 ms 3572 KiB
04.txt AC 2 ms 3576 KiB
05.txt AC 2 ms 3444 KiB
06.txt AC 3 ms 3552 KiB
07.txt AC 3 ms 3552 KiB
08.txt AC 5 ms 3392 KiB
09.txt AC 3 ms 3396 KiB
10.txt AC 3 ms 3464 KiB
11.txt AC 2 ms 3472 KiB
12.txt AC 2 ms 3580 KiB
13.txt AC 5 ms 3456 KiB
14.txt AC 5 ms 3548 KiB
15.txt AC 2 ms 3576 KiB
16.txt AC 2 ms 3616 KiB
17.txt AC 2 ms 3608 KiB
18.txt AC 2 ms 3576 KiB
19.txt AC 4 ms 3528 KiB
s1.txt AC 2 ms 3456 KiB
s2.txt AC 3 ms 3460 KiB
s3.txt AC 2 ms 3456 KiB
s4.txt AC 2 ms 3524 KiB