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