結果

問題 No.1623 三角形の制作
ユーザー chocoruskchocorusk
提出日時 2021-07-23 21:28:13
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,175 bytes
コンパイル時間 3,213 ms
コンパイル使用メモリ 187,204 KB
実行使用メモリ 5,904 KB
最終ジャッジ日時 2023-09-25 21:15:34
合計ジャッジ時間 6,107 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#include <atcoder/all>
#define popcount __builtin_popcount
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int, int> P;
ll gc[3030], bc[3030], rc[3030], rs[3030];
int main()
{
    int n; cin>>n;
    int r[200020], g[200020], b[200020];
    for(int i=0; i<n; i++){
        cin>>r[i];
        rc[r[i]]++;
    }
    for(int i=0; i<n; i++){
        cin>>g[i];
        gc[g[i]]++;
    }
    for(int i=0; i<n; i++){
        cin>>b[i];
        bc[b[i]]++;
    }
    for(int i=1; i<=3000; i++) rs[i+1]=rs[i]+rc[i];
    ll ans=0;
    for(int i=1; i<=3000; i++){
        for(int j=1; j<=3000; j++){
            ans+=gc[i]*bc[j]*(rs[i+j]-rs[max(i, j)]);
        }
    }
    cout<<ans<<endl;
    return 0;
}
0