結果
問題 | No.191 供託金 |
ユーザー | dai11 |
提出日時 | 2017-08-07 09:30:39 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 680 bytes |
コンパイル時間 | 1,866 ms |
コンパイル使用メモリ | 156,652 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 22:15:38 |
合計ジャッジ時間 | 2,128 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
コンパイルメッセージ
main.cpp: In function ‘int main(int, char**)’: main.cpp:14:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 14 | scanf("%d",&N); | ~~~~~^~~~~~~~~ main.cpp:19:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 19 | scanf("%d",&C[i]); | ~~~~~^~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h> using namespace std; int main(int argc, char **argv) { int N; //人数 int i; //ループカウンタ用 int C[500]; //格納用 int total = 0; //有効投票総数 int count = 0; //没収基準値のカウント //人数入力 scanf("%d",&N); //それぞれの候補者の得票数 for(i = 0;i < N;i++) { scanf("%d",&C[i]); total += C[i]; } //没収基準はその10分の1票 total = total / 10; //没収基準はその10分の1票と候補者の表のチェック for(i = 0;i < N;i++) { if(total >= C[i]) { count++; } } printf("%d\n",count*30); return 0; }