結果
| 問題 | No.32 貯金箱の憂鬱 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-05-08 21:46:15 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| + 505µs | |
| コード長 | 428 bytes |
| 記録 | |
| コンパイル時間 | 282 ms |
| コンパイル使用メモリ | 71,140 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-23 20:46:32 |
| 合計ジャッジ時間 | 1,313 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
ソースコード
#include <iostream>
using namespace std;
const int COINNUM = 3;
const int p[COINNUM] = {100, 25, 1};
int main(int argc, char const* argv[]) {
int total = 0, res = 0;
for (int i = 0; i < COINNUM; i++) {
int coin; cin >> coin;
total += p[i] * coin;
}
total %= 1000;
for (int i = 0; i < COINNUM; i++) {
res += total / p[i];
total %= p[i];
}
cout << res << endl;
}