結果
問題 |
No.191 供託金
|
ユーザー |
![]() |
提出日時 | 2025-08-15 01:46:16 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 465 bytes |
コンパイル時間 | 1,081 ms |
コンパイル使用メモリ | 100,160 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2025-08-15 01:46:19 |
合計ジャッジ時間 | 2,363 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
# include <iostream> # include <iomanip> # include <algorithm> using namespace std; int main() { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; int sum = 0; for (int i = 0; i < n; i++) { sum += a[i]; } int line = sum / 10; sort(a, a+n); int i = 0; int money = 0; while (line >= a[i]) { money += 30; i++; if (i==n) break; } cout << money << endl; }