結果
問題 |
No.476 正しくない平均
|
ユーザー |
|
提出日時 | 2017-03-10 15:03:06 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 260 bytes |
コンパイル時間 | 213 ms |
コンパイル使用メモリ | 20,736 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-24 07:49:46 |
合計ジャッジ時間 | 1,046 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%lld %lld",&n,&a); | ^~~~~~~~~~~~~~~~~~~~~~~~ main.c:10:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | scanf("%lld",&x[i]); | ^~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(void){ long long int i,a,A=0,n,x[10]; scanf("%lld %lld",&n,&a); for(i=0;i<n;i++){ scanf("%lld",&x[i]); A=A+x[i]; } if( (double)(a) == ( (double)(A) / (double)(n) )) printf("YES"); else printf("NO"); return 0; }