結果

問題 No.1623 三角形の制作
ユーザー gorugo30gorugo30
提出日時 2021-05-05 06:57:00
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 750 bytes
コンパイル時間 3,238 ms
コンパイル使用メモリ 198,444 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-25 20:31:42
合計ジャッジ時間 5,660 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
4,376 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int r[1001], g[1001], b[1001];
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    int x;
    for (int i = 0; i < n; i++){
        cin >> x;
        r[x]++;
    }
    for (int i = 0; i < n; i++){
        cin >> x;
        g[x]++;
    }
    for (int i = 0; i < n; i++){
        cin >> x;
        b[x]++;
    }

    long ans = 0;
    for (int i = 1; i <= 1000; i++){
        if (r[i] == 0) continue;
        for (int j = 1; j <= i; j++){
            if (g[j] == 0) continue;
            for (int k = 1; k <= i; k++){
                if (i + j >= k && j + k >= i && k + i >= j) ans += r[i] * g[j] * b[k];
            }
        }
    }
    cout << ans << endl;
}
0