結果
問題 | No.191 供託金 |
ユーザー |
|
提出日時 | 2015-06-07 17:54:20 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 286 bytes |
コンパイル時間 | 527 ms |
コンパイル使用メモリ | 37,120 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-16 20:38:59 |
合計ジャッジ時間 | 1,376 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d", &n); | ~~~~~^~~~~~~~~~ main.cpp:9:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%d", &v); | ~~~~~^~~~~~~~~~
ソースコード
#include <cstdio> #include <vector> using namespace std; int main(){ int n, v, vote = 0, cnt = 0; vector<int> c; scanf("%d", &n); for(int i=0; i<n; i++){ scanf("%d", &v); c.push_back(v); vote += v; } vote /= 10; while(n--) if(c[n] <= vote) cnt++; printf("%d\n", cnt*30); }