結果

問題 No.333 門松列を数え上げ
ユーザー yagi2
提出日時 2017-04-20 14:46:37
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 553 bytes
コンパイル時間 2,277 ms
コンパイル使用メモリ 74,512 KB
実行使用メモリ 55,980 KB
最終ジャッジ日時 2024-07-19 20:51:22
合計ジャッジ時間 7,568 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 3 WA * 4
権限があれば一括ダウンロードができます

ソースコード

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