結果

問題 No.1623 三角形の制作
ユーザー firiexpfiriexp
提出日時 2021-07-23 21:31:42
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,013 bytes
コンパイル時間 961 ms
コンパイル使用メモリ 102,580 KB
実行使用メモリ 4,572 KB
最終ジャッジ日時 2023-09-25 21:22:18
合計ジャッジ時間 2,967 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
4,380 KB
testcase_01 AC 6 ms
4,380 KB
testcase_02 AC 38 ms
4,384 KB
testcase_03 AC 37 ms
4,380 KB
testcase_04 AC 36 ms
4,384 KB
testcase_05 AC 62 ms
4,380 KB
testcase_06 AC 14 ms
4,380 KB
testcase_07 AC 37 ms
4,380 KB
testcase_08 AC 16 ms
4,384 KB
testcase_09 AC 35 ms
4,380 KB
testcase_10 AC 52 ms
4,380 KB
testcase_11 AC 42 ms
4,384 KB
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 6 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using uint = unsigned;
using ull = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;

int main() {
    int n;
    cin >> n;
    int m = 3000;
    vector<int> r(m+1), g(m+1), b(m+1);
    for (int i = 0; i < n; ++i) {
        int x;
        scanf("%d", &x);
        r[x]++;
    }
    for (int i = 0; i < n; ++i) {
        int x;
        scanf("%d", &x);
        g[x]++;
    }
    for (int i = 0; i < n; ++i) {
        int x;
        scanf("%d", &x);
        b[x]++;
    }
    for (int i = 0; i < m; ++i) {
        b[i+1] += b[i];
    }
    ll ans = 0;
    for (int i = 0; i <= m; ++i) {
        for (int j = 0; j <= i; ++j) {
            ans += r[i]*g[j]*(b[i]-b[i-j]);
        }
    }
    cout << ans << "\n";
    return 0;
}
0