結果

問題 No.191 供託金
コンテスト
ユーザー tsukacchan
提出日時 2016-03-24 12:31:52
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 327 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 158 ms
コンパイル使用メモリ 30,408 KB
最終ジャッジ日時 2026-02-23 21:00:43
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:10:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 | scanf("%d",&N);
      | ^~~~~~~~~~~~~~
main.c:14:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   14 | scanf("%d",&c[i]);
      | ^~~~~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include<stdio.h>

int main(void){

int i,N;
int c[100];
int total=0;
int deposit_money=0;

scanf("%d",&N);

for(i=0;i<N;i++)
{
scanf("%d",&c[i]);
total += c[i];
}

for(i=0;i<N;i++)
if((((double)c[i]*100)/(double)total) <= 10) deposit_money += 30;

if(total==0)
printf("%d",N*30);
else
printf("%d",deposit_money);

return 0;

}
0