結果
問題 |
No.476 正しくない平均
|
ユーザー |
![]() |
提出日時 | 2017-01-29 14:14:40 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 293 bytes |
コンパイル時間 | 281 ms |
コンパイル使用メモリ | 21,248 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 23:09:38 |
合計ジャッジ時間 | 1,146 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 17 WA * 9 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:15:17: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘long long int *’ [-Wformat=] 15 | scanf("%d",&x[i]); | ~^ ~~~~~ | | | | | long long int * | int * | %lld main.c:11:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf("%lld%lld",&n,&a); | ^~~~~~~~~~~~~~~~~~~~~~~ main.c:15:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 15 | scanf("%d",&x[i]); | ^~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(void) { long long n; long long a; long long x[10]; int i; int d=0; double k; scanf("%lld%lld",&n,&a); for(i=0;i<n;i++){ scanf("%d",&x[i]); d+=x[i]; } //printf("%d",d); k=d/n; if(k==a){ printf("YES\n"); }else{ printf("NO\n"); } return 0; }