結果
問題 | No.32 貯金箱の憂鬱 |
ユーザー |
![]() |
提出日時 | 2015-12-07 14:02:12 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 54 ms / 5,000 ms |
コード長 | 617 bytes |
コンパイル時間 | 2,060 ms |
コンパイル使用メモリ | 74,744 KB |
実行使用メモリ | 50,344 KB |
最終ジャッジ日時 | 2024-07-23 02:12:51 |
合計ジャッジ時間 | 3,255 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 |
ソースコード
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;public class Main {public static void main(String[] args) {BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));try {final int[] MONEY = { 100, 25, 1 };int sum = 0;for (int i = 0; i < 3; ++i) {sum += MONEY[i] * Integer.parseInt(buff.readLine());}int ans = 0;sum %= 1000;for(int i = 0; i < 3; ++i){ans += sum / MONEY[i];sum %= MONEY[i];}System.out.println(ans);} catch (NumberFormatException e) {} catch (IOException e) {}}}