結果

問題 No.333 門松列を数え上げ
ユーザー neko_the_shadowneko_the_shadow
提出日時 2019-03-01 10:42:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 393 bytes
コンパイル時間 1,974 ms
コンパイル使用メモリ 71,156 KB
実行使用メモリ 56,544 KB
最終ジャッジ日時 2023-09-05 16:28:18
合計ジャッジ時間 3,942 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
55,852 KB
testcase_01 AC 117 ms
56,068 KB
testcase_02 AC 115 ms
56,008 KB
testcase_03 AC 114 ms
56,048 KB
testcase_04 AC 117 ms
56,172 KB
testcase_05 AC 118 ms
56,460 KB
testcase_06 AC 115 ms
56,144 KB
testcase_07 AC 116 ms
56,544 KB
testcase_08 AC 116 ms
56,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);
        long a = stdin.nextLong();
        long b = stdin.nextLong();
        
        if (a < b) { // b > c
            System.out.println(b - 2);
        } else { // a > b && b < c
            System.out.println(2000000000 - b - 1);
        }
    }
}
0