結果
問題 | No.118 門松列(2) |
ユーザー |
![]() |
提出日時 | 2015-03-05 00:19:31 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 10 ms / 5,000 ms |
コード長 | 473 bytes |
コンパイル時間 | 226 ms |
コンパイル使用メモリ | 23,552 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-09 06:53:27 |
合計ジャッジ時間 | 1,121 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 26 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:11:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf("%d", &N); | ~~~~~^~~~~~~~~~ main.cpp:15:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 15 | scanf("%d", &a); | ~~~~~^~~~~~~~~~
ソースコード
#include <cstdio> typedef long long ll; const ll MOD = 1000000000ll + 7; int c[101]; int main(){ int N; scanf("%d", &N); for(int i=0;i<N;i++){ int a; scanf("%d", &a); c[a]++; } ll res = 0ll; for(int i=1;i<=100;i++){ for(int j=i+1;j<=100;j++){ for(int k=j+1;k<=100;k++){ res = (res + c[i] * c[j] % MOD * c[k] % MOD) % MOD; } } } printf("%lld\n", res); }