結果

問題 No.32 貯金箱の憂鬱
ユーザー ARCANAARCANA
提出日時 2023-06-28 00:05:30
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 474 bytes
コンパイル時間 460 ms
コンパイル使用メモリ 66,176 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-04 16:19:48
合計ジャッジ時間 1,151 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>

using namespace std;

int main(){
  // input
  int L,M,N;
  cin >> L>>M>>N;
  int total = 100*L + 25*M + N;
  int count = 0;
  while(total > 0){
    if(total >=1000){
      total -= 1000;
    }
    else if(total >=100){
      total -= 100;
      count++;
    }
    else if(total >=25){
      total -= 25;
      count++;
    }
    else if(total >=1){
      total -= 1;
      count++;
    }
  }



  cout << count << endl;
  // output 
}
0