結果

問題 No.383 レーティング
ユーザー matsuyoshi30matsuyoshi30
提出日時 2017-02-26 23:18:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 556 bytes
コンパイル時間 2,203 ms
コンパイル使用メモリ 79,940 KB
実行使用メモリ 56,448 KB
最終ジャッジ日時 2023-09-02 10:14:03
合計ジャッジ時間 4,660 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,900 KB
testcase_01 AC 124 ms
56,312 KB
testcase_02 AC 124 ms
55,820 KB
testcase_03 AC 123 ms
56,024 KB
testcase_04 AC 124 ms
56,100 KB
testcase_05 AC 124 ms
55,668 KB
testcase_06 AC 122 ms
55,736 KB
testcase_07 AC 124 ms
56,448 KB
testcase_08 AC 124 ms
55,872 KB
testcase_09 AC 123 ms
56,060 KB
testcase_10 AC 126 ms
55,736 KB
testcase_11 AC 125 ms
56,176 KB
testcase_12 AC 123 ms
55,744 KB
testcase_13 AC 123 ms
55,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();

        if(a == b) {
            System.out.println(0);
        } else if(a < b) {
            System.out.print("+");
            System.out.println(b-a);
        } else {
            System.out.print("-");
            System.out.println(a-b);
        }

        in.close();
    }
}
0