結果
問題 | No.118 門松列(2) |
ユーザー |
![]() |
提出日時 | 2015-07-28 13:26:51 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 426 bytes |
コンパイル時間 | 121 ms |
コンパイル使用メモリ | 21,504 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-16 04:43:38 |
合計ジャッジ時間 | 1,174 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 WA * 1 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | scanf("%d",&N); | ^~~~~~~~~~~~~~ main.c:12:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 12 | scanf("%d",&t); | ^~~~~~~~~~~~~~
ソースコード
#include<stdio.h> int main(void){ int N; scanf("%d",&N); int A[101]; int i; for(i=1;i<=100;i++) A[i]=0; for(i=0;i<N;i++){ int t; scanf("%d",&t); A[t]++; } long long int way=0; for(i=1;i<=100-2;i++){ if(A[i]!=0){ int j; for(j=i+1;j<=100-1;j++){ if(A[j]!=0){ int k; for(k=j+1;k<=100;k++){ way+=A[i]*A[j]*A[k]; } } } } } printf("%lld\n",way%1000000007); return 0; }