結果

問題 No.780 オフ会
ユーザー Subaru314Subaru314
提出日時 2021-05-23 23:21:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 2,762 ms
コンパイル使用メモリ 75,524 KB
実行使用メモリ 41,572 KB
最終ジャッジ日時 2024-04-20 08:39:40
合計ジャッジ時間 6,709 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
41,324 KB
testcase_01 AC 136 ms
41,572 KB
testcase_02 AC 135 ms
41,164 KB
testcase_03 AC 134 ms
41,012 KB
testcase_04 AC 136 ms
41,120 KB
testcase_05 AC 141 ms
41,232 KB
testcase_06 AC 135 ms
41,336 KB
testcase_07 AC 123 ms
39,984 KB
testcase_08 AC 135 ms
41,052 KB
testcase_09 AC 137 ms
41,192 KB
testcase_10 AC 138 ms
40,996 KB
testcase_11 AC 137 ms
41,124 KB
testcase_12 AC 137 ms
41,300 KB
testcase_13 AC 136 ms
41,408 KB
testcase_14 AC 137 ms
41,272 KB
testcase_15 AC 137 ms
41,508 KB
testcase_16 AC 138 ms
41,384 KB
testcase_17 AC 136 ms
41,196 KB
testcase_18 AC 139 ms
41,264 KB
testcase_19 AC 132 ms
41,064 KB
testcase_20 AC 137 ms
41,312 KB
testcase_21 AC 135 ms
41,204 KB
testcase_22 AC 137 ms
41,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        a++;
        if(a<=b){
            System.out.println("YES");
            System.out.println(b-a);
        }else{
            System.out.println("NO");
            System.out.println(a-b);
        }
    }
}
0