結果

問題 No.118 門松列(2)
ユーザー otsnskotsnsk
提出日時 2015-01-14 16:59:03
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 929 bytes
コンパイル時間 1,095 ms
コンパイル使用メモリ 79,248 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-04 13:01:36
合計ジャッジ時間 3,093 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 28 ms
4,380 KB
testcase_02 AC 28 ms
4,380 KB
testcase_03 AC 28 ms
4,380 KB
testcase_04 AC 27 ms
4,376 KB
testcase_05 AC 27 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 26 ms
4,380 KB
testcase_10 AC 16 ms
4,380 KB
testcase_11 AC 17 ms
4,380 KB
testcase_12 AC 15 ms
4,376 KB
testcase_13 AC 14 ms
4,380 KB
testcase_14 AC 26 ms
4,376 KB
testcase_15 AC 14 ms
4,376 KB
testcase_16 AC 21 ms
4,376 KB
testcase_17 AC 14 ms
4,380 KB
testcase_18 AC 17 ms
4,384 KB
testcase_19 AC 19 ms
4,376 KB
testcase_20 AC 20 ms
4,380 KB
testcase_21 AC 24 ms
4,380 KB
testcase_22 AC 16 ms
4,376 KB
testcase_23 AC 23 ms
4,380 KB
testcase_24 AC 18 ms
4,380 KB
testcase_25 AC 19 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>

#define FORR(i,b,e) for(int i=(b);i<(int)(e);++i)
#define FOR(i,e) FORR(i,0,e)
#define dump(var) cerr << #var ": " << var << "\n"
#define dumpc(con) for(auto& e: con) cerr << e << " "; cerr<<"\n"

typedef long long ll;
typedef unsigned long long ull;

const ull MODD = 1e9+7;

using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int N;
    vector<int> A;
    map<int,int> acnt;

    cin >> N;
    A.resize(N);
    FOR(i, N) {
        cin >> A[i];
        acnt[A[i]]++;
    }
    sort(A.begin(), A.end());
    A.erase(unique(A.begin(), A.end()), A.end());

    ull pcnt = 0;
    int l = A.size();
    FOR(i, l-2) {
        FORR(j, i+1, l-1) {
            FORR(k, j+1, l) {
                pcnt = (pcnt + acnt[A[i]]*acnt[A[j]]*acnt[A[k]]) % MODD;
            }
        }
    }
    cout << pcnt << endl;

    return 0;
}
0