結果
問題 | No.118 門松列(2) |
ユーザー |
![]() |
提出日時 | 2016-04-27 09:26:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 8 ms / 5,000 ms |
コード長 | 691 bytes |
コンパイル時間 | 1,424 ms |
コンパイル使用メモリ | 167,980 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 00:06:02 |
合計ジャッジ時間 | 2,307 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 26 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for (int i=0;i<(n);i++) #define rep2(i,a,b) for (int i=(a);i<(b);i++) #define rrep(i,n) for (int i=(n)-1;i>=0;i--) #define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--) #define all(a) (a).begin(),(a).end() typedef long long ll; typedef pair<int, int> P; const ll mod = 1e9 + 7; signed main() { std::ios::sync_with_stdio(false); std::cin.tie(0); ll N; cin >> N; vector<ll> cnt(100, 0); rep(i, N) { ll a; cin >> a; a--; cnt[a]++; } ll ans = 0; rep(k, 100) rep(j, k) rep(i, j) { ans += cnt[i] * cnt[j] * cnt[k]; } cout << ans % mod << endl; }