結果

問題 No.2681 ゲームセンターの両替
ユーザー kokosei
提出日時 2024-03-20 22:40:13
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 453 bytes
コンパイル時間 2,408 ms
コンパイル使用メモリ 243,844 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-05 04:13:23
合計ジャッジ時間 3,106 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int C, Y;
int m[] = {1, 5, 10, 20, 50, 100};
int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    cin >> C >> Y;
    Y /= 100;
    if(Y < C){
        cout << "can't exchange\n";
        return 0;
    }
    if(Y % 5 >= C){
        cout << "no exchange\n";
        return 0;
    }
    C -= Y % 5;
    cout << ((C + 4) / 5 * 5 + Y % 5) << "\n";
    return 0;
}
0