結果

問題 No.2681 ゲームセンターの両替
ユーザー tentententen
提出日時 2024-03-25 09:50:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 60 ms / 2,000 ms
コード長 1,263 bytes
コンパイル時間 2,243 ms
コンパイル使用メモリ 78,492 KB
実行使用メモリ 50,492 KB
最終ジャッジ日時 2024-04-15 10:14:06
合計ジャッジ時間 4,632 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
50,368 KB
testcase_01 AC 58 ms
50,492 KB
testcase_02 AC 60 ms
50,296 KB
testcase_03 AC 57 ms
50,128 KB
testcase_04 AC 57 ms
50,208 KB
testcase_05 AC 58 ms
50,248 KB
testcase_06 AC 56 ms
50,096 KB
testcase_07 AC 58 ms
50,368 KB
testcase_08 AC 57 ms
49,984 KB
testcase_09 AC 56 ms
50,352 KB
testcase_10 AC 57 ms
50,240 KB
testcase_11 AC 56 ms
50,448 KB
testcase_12 AC 57 ms
50,256 KB
testcase_13 AC 57 ms
49,952 KB
testcase_14 AC 58 ms
50,260 KB
testcase_15 AC 56 ms
50,096 KB
testcase_16 AC 59 ms
50,224 KB
testcase_17 AC 59 ms
50,240 KB
testcase_18 AC 56 ms
50,320 KB
testcase_19 AC 58 ms
50,040 KB
testcase_20 AC 56 ms
50,236 KB
testcase_21 AC 58 ms
50,404 KB
testcase_22 AC 55 ms
50,124 KB
testcase_23 AC 56 ms
50,224 KB
testcase_24 AC 56 ms
50,120 KB
testcase_25 AC 57 ms
50,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.util.function.*;
import java.util.stream.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int c = sc.nextInt();
        int target = sc.nextInt() / 100;
        System.out.println(c > target ? "can't exchange" : (target % 5 >= c ? "no exchange" : (target - c) % 5 + c));
    }
}
class Scanner {
    BufferedReader br;
    StringTokenizer st = new StringTokenizer("");
    StringBuilder sb = new StringBuilder();
    
    public Scanner() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
        } catch (Exception e) {
            
        }
    }
    
    public int nextInt() {
        return Integer.parseInt(next());
    }
    
    public long nextLong() {
        return Long.parseLong(next());
    }
    
    public double nextDouble() {
        return Double.parseDouble(next());
    }
    
    public String next() {
        try {
            while (!st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            return st.nextToken();
        }
    }
    
}
0