結果
問題 | No.476 正しくない平均 |
ユーザー |
|
提出日時 | 2017-01-27 22:26:30 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 228 bytes |
コンパイル時間 | 431 ms |
コンパイル使用メモリ | 20,608 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 09:44:56 |
合計ジャッジ時間 | 1,433 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d %ld",&n,&a); | ^~~~~~~~~~~~~~~~~~~~~ main.c:8:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%ld",&x); | ^~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>int main(){int n,i;long sum=0,x,a;scanf("%d %ld",&n,&a);for(i=n;i>0;i--){scanf("%ld",&x);sum+=x;}if(((sum/(long)n)==a) && (sum%(long)n==0)) printf("YES\n");else printf("NO\n");return 0;}