結果
問題 | No.191 供託金 |
ユーザー | hadrori |
提出日時 | 2015-07-25 17:26:44 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 404 bytes |
コンパイル時間 | 1,499 ms |
コンパイル使用メモリ | 157,708 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-16 20:56:21 |
合計ジャッジ時間 | 2,425 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
コンパイルメッセージ
main.cpp: In function ‘void input()’: main.cpp:15:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 15 | scanf("%d", &n); | ~~~~~^~~~~~~~~~ main.cpp:16:19: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 16 | rep(i,n) scanf("%d", c+i); | ~~~~~^~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>using namespace std;#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);i++)#define rep(i,n) repi(i,0,n)int n, c[128];int solve() {int m = accumulate(c,c+n,0), sum = 0;rep(i,n) if(c[i] <= m/10) sum += 30;return sum;}void input() {scanf("%d", &n);rep(i,n) scanf("%d", c+i);}int main() {input();printf("%d\n", solve());return 0;}