結果
問題 | No.118 門松列(2) |
ユーザー |
![]() |
提出日時 | 2016-06-03 11:36:30 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 19 ms / 5,000 ms |
コード長 | 471 bytes |
コンパイル時間 | 563 ms |
コンパイル使用メモリ | 64,304 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 08:11:33 |
合計ジャッジ時間 | 1,704 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 26 |
ソースコード
#include <iostream> #include <math.h> #include <vector> using namespace std; typedef long long ll; int N; ll ans = 0; const long long mod = 1e9 + 7; int main() { cin >> N; vector<ll> A(100, 0); for (int i = 0; i < N; i++) { int k; cin >> k; A[k-1]++; } for (int i = 0; i < 100; i++) { for (int j = i + 1; j < 100; j++) { for (int k = j + 1; k < 100; k++) { ans += A[i] * A[j] * A[k]; } } } cout << ans % mod <<endl; return 0; }