結果
問題 |
No.118 門松列(2)
|
ユーザー |
![]() |
提出日時 | 2015-03-05 00:18:46 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 471 bytes |
コンパイル時間 | 331 ms |
コンパイル使用メモリ | 23,424 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-24 07:59:25 |
合計ジャッジ時間 | 1,603 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 WA * 21 |
コンパイルメッセージ
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] % MOD * c[j] % MOD * c[k] % MOD; } } } printf("%lld\n", res); }