結果

問題 No.191 供託金
ユーザー Maeda
提出日時 2025-03-18 09:36:18
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 383 bytes
コンパイル時間 479 ms
コンパイル使用メモリ 25,472 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-18 09:36:20
合計ジャッジ時間 1,595 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |         scanf("%d",&candidacyNum);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~
main.c:9:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |                 scanf("%d",&votesList[i]);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

void main(void) {
	int candidacyNum = 0;
	scanf("%d",&candidacyNum);
	int votesList[candidacyNum];
	int total = 0;
	for(int i = 0 ; i < candidacyNum ; i++){
		scanf("%d",&votesList[i]);
		total += votesList[i];
	}
	total /= 10;
	int result = 0;
	for(int i = 0 ; i < candidacyNum ; i++){
		if(votesList[i] <= total){
			result += 30;
		}
	}
	printf("%d",result);
}
0