結果

問題 No.333 門松列を数え上げ
ユーザー yagi2yagi2
提出日時 2017-04-20 14:46:37
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 553 bytes
コンパイル時間 2,010 ms
コンパイル使用メモリ 71,980 KB
実行使用メモリ 55,952 KB
最終ジャッジ日時 2023-09-27 03:28:13
合計ジャッジ時間 7,438 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,796 KB
testcase_01 WA -
testcase_02 AC 117 ms
55,792 KB
testcase_03 AC 1,249 ms
55,836 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 204 ms
55,916 KB
testcase_08 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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

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

        long cnt = 0;
        if (A > B) {
            for (long i = A + 1; i < 2000000000; i++) {
                cnt++;
            }
        } else {
            for (long i = 1; i < B; i++) {
                if (i == A) continue;
                cnt++;
            }
        }

        System.out.println(cnt);
    }
}
0