結果
問題 |
No.476 正しくない平均
|
ユーザー |
![]() |
提出日時 | 2017-01-29 15:16:30 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 302 bytes |
コンパイル時間 | 292 ms |
コンパイル使用メモリ | 21,888 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 10:03:49 |
合計ジャッジ時間 | 1,083 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 26 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:12:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 12 | scanf("%d%lld",&n,&a); | ^~~~~~~~~~~~~~~~~~~~~ main.c:14:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 14 | scanf("%lld",&x[i]); | ^~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(void) { int n; long long x[10]; long long a; int i; long double s=0; double as; scanf("%d%lld",&n,&a); for(i=0;i<n;i++){ scanf("%lld",&x[i]); } for(i=0;i<n;i++){ s+=x[i]; } as=s/n; //printf("%f\n",as); if(as==a){ puts("YES\n"); }else{ puts("NO\n"); } return 0; }