結果

問題 No.383 レーティング
ユーザー matsuyoshi30matsuyoshi30
提出日時 2017-02-26 23:18:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 556 bytes
コンパイル時間 2,345 ms
コンパイル使用メモリ 75,304 KB
実行使用メモリ 41,680 KB
最終ジャッジ日時 2024-06-11 16:55:51
合計ジャッジ時間 4,940 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
41,164 KB
testcase_01 AC 132 ms
41,300 KB
testcase_02 AC 132 ms
41,340 KB
testcase_03 AC 134 ms
41,452 KB
testcase_04 AC 132 ms
41,680 KB
testcase_05 AC 129 ms
41,592 KB
testcase_06 AC 130 ms
41,312 KB
testcase_07 AC 132 ms
41,332 KB
testcase_08 AC 119 ms
40,276 KB
testcase_09 AC 132 ms
41,328 KB
testcase_10 AC 132 ms
41,332 KB
testcase_11 AC 131 ms
41,668 KB
testcase_12 AC 132 ms
41,604 KB
testcase_13 AC 129 ms
41,232 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