結果

問題 No.32 貯金箱の憂鬱
ユーザー yukimarusanyukimarusan
提出日時 2018-12-31 19:11:46
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 418 bytes
コンパイル時間 400 ms
コンパイル使用メモリ 59,804 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-30 13:22:17
合計ジャッジ時間 1,089 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,384 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
 int l,m,n,msum=0;cin>>l>>m>>n;
 //1円玉が25枚以上あったら25円玉に両替。mにプラス。
 m+=n/25;
 msum+=n%25;
 
 //25円玉が4枚以上あったら100円玉に両替。lにプラス。
 l+=m/4;
 msum+=m%4;
 
 //100円玉が10枚以上あったら1000円札に両替。
 msum+=l%10;
 
 cout<<msum<<endl;
}
0