結果

問題 No.476 正しくない平均
ユーザー mono1977
提出日時 2017-01-27 22:25:48
言語 C90
(gcc 12.3.0)
結果
RE  
実行時間 -
コード長 372 bytes
コンパイル時間 136 ms
コンパイル使用メモリ 22,400 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-23 16:06:46
合計ジャッジ時間 1,170 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24 RE * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
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);
      |                 ^~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#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==sum/n && sum%a==0){
		puts("YES");
	}else{
		puts("NO");
	}
	
    return 0;
}
0