結果
問題 | No.118 門松列(2) |
ユーザー |
![]() |
提出日時 | 2015-01-19 20:13:08 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 19 ms / 5,000 ms |
コード長 | 710 bytes |
コンパイル時間 | 543 ms |
コンパイル使用メモリ | 71,040 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 06:52:25 |
合計ジャッジ時間 | 1,607 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 26 |
ソースコード
#include <vector> #include <queue> #include <deque> #include <stack> #include <algorithm> #include <functional> #include <iostream> #include <cstdio> #include <cmath> #include <cstdlib> #include <ctime> #include <cctype> #include <string> #include <cstring> using namespace std; typedef long long ll; #define MODN 1000000007 int main() { ll n; cin >> n; ll memo[101]; memset(memo, 0, sizeof(memo)); ll a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; memo[a[i]]++; } ll ans = 0; for (int i = 0; i < 101; i++) { for (int j = i+1; j < 101; j++) { for (int k = j+1; k < 101; k++) { ans += memo[i]*memo[j]*memo[k]; } } } ans %= MODN; cout << ans << endl; }