結果
| 問題 |
No.476 正しくない平均
|
| コンテスト | |
| ユーザー |
mono1977
|
| 提出日時 | 2017-01-27 22:23:34 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 348 bytes |
| コンパイル時間 | 274 ms |
| コンパイル使用メモリ | 22,528 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-23 16:03:11 |
| 合計ジャッジ時間 | 1,017 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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 %ld",&n,&a);
| ^~~~~~~~~~~~~~~~~~~~~
main.c:16:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
16 | scanf("%ld",&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 a,x;
long temp,sum=0;
scanf("%d %ld",&n,&a);
for(i=0;i<n;i++){
scanf("%ld",&temp);
sum+=temp;
}
if(a==sum/n){
puts("YES");
}else{
puts("NO");
}
return 0;
}
mono1977