結果
問題 | No.2681 ゲームセンターの両替 |
ユーザー |
|
提出日時 | 2024-08-01 20:50:49 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 91 ms / 2,000 ms |
コード長 | 354 bytes |
コンパイル時間 | 1,077 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-08-01 20:50:54 |
合計ジャッジ時間 | 4,396 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
コンパイルメッセージ
Syntax OK
ソースコード
module Exchange def solve(c, y) cex = y / 500 * 5 ch = y % 500 / 100 if ch >= c "no exchange" else nd = ((c - ch) + 4) / 5 * 5 if nd <= cex ch + nd else "can't exchange" end end end module_function :solve end c, y = gets.chomp.split(/\s+/).map(&:to_i) puts Exchange.solve(c, y)