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