結果

問題 No.383 レーティング
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-05-03 21:52:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 824 bytes
コンパイル時間 2,273 ms
コンパイル使用メモリ 73,824 KB
実行使用メモリ 35,068 KB
最終ジャッジ日時 2023-10-12 08:03:23
合計ジャッジ時間 4,175 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
34,552 KB
testcase_01 AC 60 ms
34,556 KB
testcase_02 AC 39 ms
33,248 KB
testcase_03 AC 60 ms
35,068 KB
testcase_04 AC 60 ms
34,964 KB
testcase_05 AC 60 ms
34,552 KB
testcase_06 AC 60 ms
35,064 KB
testcase_07 AC 64 ms
34,548 KB
testcase_08 AC 64 ms
34,580 KB
testcase_09 AC 75 ms
35,044 KB
testcase_10 AC 64 ms
34,576 KB
testcase_11 AC 68 ms
34,528 KB
testcase_12 AC 59 ms
34,420 KB
testcase_13 AC 61 ms
34,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.stream.Stream;

import static java.lang.System.in;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        String[] inputs = reader.readLine().split(" ");
        int a = Integer.parseInt(inputs[0]);
        int b = Integer.parseInt(inputs[1]);
        System.out.println(formatRateChange(a,b));
    }

    private static String formatRateChange(int previous, int current) {
        if(previous==current) {
            return "0";
        } else if (previous < current) {
            return "+" + (current-previous);
        } else {
            return "-" + (previous-current);
        }
    }
}
0