結果
| 問題 | No.32 貯金箱の憂鬱 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-05-08 21:46:15 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 428 bytes |
| 記録 | |
| コンパイル時間 | 550 ms |
| コンパイル使用メモリ | 54,360 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-23 07:10:47 |
| 合計ジャッジ時間 | 1,143 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}