結果
問題 |
No.2681 ゲームセンターの両替
|
ユーザー |
|
提出日時 | 2024-03-20 21:13:58 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 28 ms / 2,000 ms |
コード長 | 370 bytes |
コンパイル時間 | 3,494 ms |
コンパイル使用メモリ | 250,800 KB |
最終ジャッジ日時 | 2025-02-20 08:30:23 |
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using ll = long long; #define rep(i,n) for(ll i=0;i<(ll)(n);i++) using mint = atcoder::modint998244353; int main(){ ll c,y; cin>>c>>y; if(c*100>y){ cout<<"can't exchange\n"; return 0; } ll nc=(y%500)/100; if(nc>=c){ cout<<"no exchange\n"; return 0; } cout<<((c-nc+4)/5)*5+nc<<endl; }