結果

問題 No.118 門松列(2)
ユーザー akakimidori
提出日時 2015-07-28 13:21:47
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 426 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 21,376 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-16 04:43:23
合計ジャッジ時間 1,317 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
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);
      |                 ^~~~~~~~~~~~~~

ソースコード

diff #

#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%1000000009);
	return 0;
}
0