結果
問題 |
No.476 正しくない平均
|
ユーザー |
![]() |
提出日時 | 2017-01-27 22:24:24 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 360 bytes |
コンパイル時間 | 299 ms |
コンパイル使用メモリ | 22,272 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 16:03:48 |
合計ジャッジ時間 | 1,050 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 20 WA * 6 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:13:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 13 | scanf("%d %lld",&n,&a); | ^~~~~~~~~~~~~~~~~~~~~~ main.c:16:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 16 | scanf("%lld",&temp); | ^~~~~~~~~~~~~~~~~~~
ソースコード
#include <math.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <assert.h> #include <limits.h> #include <stdbool.h> int main(){ int n,i; long long a,x; long long temp,sum=0; scanf("%d %lld",&n,&a); for(i=0;i<n;i++){ scanf("%lld",&temp); sum+=temp; } if(a==sum/n){ puts("YES"); }else{ puts("NO"); } return 0; }