結果
問題 | No.476 正しくない平均 |
ユーザー |
![]() |
提出日時 | 2018-05-30 23:24:38 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 335 bytes |
コンパイル時間 | 115 ms |
コンパイル使用メモリ | 22,528 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 08:26:28 |
合計ジャッジ時間 | 1,004 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 20 WA * 6 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:7:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%lld %lld\n", &N, &a); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~ main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%lld", &num[i]); | ~~~~~^~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>int main(){long long int N, a, i;long long int num[10], ave = 0;scanf("%lld %lld\n", &N, &a);for(i = 0; i < N; i++){scanf("%lld", &num[i]);ave += num[i];}ave /= N;if(a == ave){printf("YES\n");}else{printf("NO\n");}return 0;}