結果

問題 No.333 門松列を数え上げ
ユーザー yagi2yagi2
提出日時 2017-04-20 14:53:02
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 591 bytes
コンパイル時間 2,286 ms
コンパイル使用メモリ 72,392 KB
実行使用メモリ 58,052 KB
最終ジャッジ日時 2023-09-27 03:30:47
合計ジャッジ時間 15,460 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,816 KB
testcase_01 TLE -
testcase_02 AC 117 ms
55,368 KB
testcase_03 AC 1,262 ms
56,076 KB
testcase_04 WA -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 AC 218 ms
55,684 KB
testcase_08 TLE -
権限があれば一括ダウンロードができます

ソースコード

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 = B + 1; i < 2000000000; i++) {
                if (i == A) continue;
                cnt++;
            }
        } else {
            for (long i = 1; i < B; i++) {
                if (i == A) continue;
                cnt++;
            }
        }

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