結果
問題 |
No.191 供託金
|
ユーザー |
|
提出日時 | 2018-03-16 19:45:36 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 500 bytes |
コンパイル時間 | 177 ms |
コンパイル使用メモリ | 23,296 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-21 14:38:00 |
合計ジャッジ時間 | 1,184 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 WA * 1 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:5:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | scanf("%d",&N); | ~~~~~^~~~~~~~~ main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%d",&C[i]); | ~~~~~^~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(){ //input int N; scanf("%d",&N); int C[100]; for (int i = 0;i < N;i++){ scanf("%d",&C[i]); } //total vote int vTotal = 0; for (int i = 0;i < N;i++){ vTotal += C[i]; } //total money to yukikoda int mTotal = 0; for (int i = 0;i < N;i++){ double rate = 1.0*C[i]/vTotal; if (rate <= 0.1){ mTotal += 30; } } //output printf("%d\n",mTotal); return 0; }