結果
問題 |
No.118 門松列(2)
|
ユーザー |
👑 |
提出日時 | 2020-03-09 03:39:39 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 20 ms / 5,000 ms |
コード長 | 604 bytes |
コンパイル時間 | 512 ms |
コンパイル使用メモリ | 65,652 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 20:31:38 |
合計ジャッジ時間 | 1,639 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 26 |
ソースコード
#include <iostream> using namespace std; const int mod = 1000000007; long long A[100]; int main(){ int n;cin>>n; for(int i = 0; n > i; i++){ int t;cin>>t; A[--t]++; } long long ans = 0; for(int i = 0; 100 > i; i++){ if(!A[i])continue; for(int j = i; 100 > j; j++){ if(i==j)continue; if(!A[j])continue; for(int k = j; 100 > k; k++){ if(i==k||j==k)continue; if(!A[k])continue; ans = (ans+A[i]*A[j]*A[k])%mod; } } } cout << ans << endl; }