結果

問題 No.1131 Deviation Score
ユーザー Maeda
提出日時 2025-03-19 11:46:48
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 353 bytes
コンパイル時間 574 ms
コンパイル使用メモリ 28,032 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-19 11:46:50
合計ジャッジ時間 1,818 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d",&n);
      |         ^~~~~~~~~~~~~~
main.c:11:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |                 scanf("%d",&points[i]);
      |                 ^~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <math.h>

void main(void){
	int n = 0;
	scanf("%d",&n);
	int points[n];
	//int deviationValue[n];
	double ave = 0;
	for(int i = 0; i < n ; i++){
		scanf("%d",&points[i]);
		ave += (double)points[i];
	} 
	ave = ave/n;
	for(int i = 0; i < n ; i++){
		int result = floor(50 - (ave-points[i])/2);
		printf("%d\n", result );
	} 
}
0