結果
| 問題 | No.32 貯金箱の憂鬱 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-05-08 21:46:15 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 428 bytes |
| 記録 | |
| コンパイル時間 | 524 ms |
| コンパイル使用メモリ | 71,880 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-04-03 13:09:36 |
| 合計ジャッジ時間 | 915 ms |
|
ジャッジサーバーID (参考情報) |
judge4_1 / judge2_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;
}