結果

問題 No.1131 Deviation Score
ユーザー kikage
提出日時 2020-10-06 16:29:43
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 281 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 22,784 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-20 02:07:02
合計ジャッジ時間 1,720 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 1 WA * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:4:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    4 |     scanf("%d",&N);
      |     ~~~~~^~~~~~~~~
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d",&x[i]);
      |         ~~~~~^~~~~~~~~~~~

ソースコード

diff #

#include <cstdio>
int main(){
    int N,x[100000],sum=0;
    scanf("%d",&N);
    for(int i=0;i<N;i++){
        scanf("%d",&x[i]);
        sum+=x[i];
    }
    int ave=sum/N;
    for(int i=0;i<N;i++){
        printf("%d\n",(100+x[i]-ave)/2);
        sum+=x[i];
    }
    return 0;
}
0