結果

問題 No.383 レーティング
ユーザー yagi2yagi2
提出日時 2017-04-17 15:52:27
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 453 bytes
コンパイル時間 2,631 ms
コンパイル使用メモリ 76,164 KB
実行使用メモリ 56,108 KB
最終ジャッジ日時 2023-09-26 10:40:16
合計ジャッジ時間 6,186 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
55,648 KB
testcase_01 AC 137 ms
55,412 KB
testcase_02 AC 121 ms
55,396 KB
testcase_03 AC 138 ms
56,064 KB
testcase_04 AC 138 ms
55,780 KB
testcase_05 AC 138 ms
56,104 KB
testcase_06 AC 139 ms
56,024 KB
testcase_07 AC 138 ms
55,756 KB
testcase_08 AC 141 ms
55,748 KB
testcase_09 AC 137 ms
55,684 KB
testcase_10 AC 136 ms
56,108 KB
testcase_11 AC 135 ms
55,556 KB
testcase_12 AC 136 ms
55,756 KB
testcase_13 AC 136 ms
55,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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

        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());

        if (A == B) {
            System.out.println("0");
        } else if (A > B) {
            System.out.println("-" + (A-B));
        } else if (A < B) {
            System.out.println("+" + (B-A));
        }
    }
}
0