結果

問題 No.9010 うるう年判定
ユーザー yagi2yagi2
提出日時 2017-04-21 17:03:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 742 bytes
コンパイル時間 3,555 ms
コンパイル使用メモリ 72,396 KB
実行使用メモリ 56,276 KB
最終ジャッジ日時 2023-09-04 00:59:00
合計ジャッジ時間 8,147 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,872 KB
testcase_01 AC 115 ms
54,340 KB
testcase_02 AC 116 ms
56,040 KB
testcase_03 AC 114 ms
56,188 KB
testcase_04 AC 115 ms
56,116 KB
testcase_05 AC 116 ms
55,896 KB
testcase_06 AC 116 ms
55,920 KB
testcase_07 AC 116 ms
56,236 KB
testcase_08 AC 116 ms
55,892 KB
testcase_09 AC 118 ms
55,796 KB
testcase_10 AC 116 ms
56,088 KB
testcase_11 AC 116 ms
56,044 KB
testcase_12 AC 116 ms
55,672 KB
testcase_13 AC 116 ms
56,104 KB
testcase_14 AC 115 ms
55,716 KB
testcase_15 AC 114 ms
56,160 KB
testcase_16 AC 114 ms
55,412 KB
testcase_17 AC 114 ms
56,208 KB
testcase_18 AC 116 ms
55,640 KB
testcase_19 AC 116 ms
55,848 KB
testcase_20 AC 115 ms
55,996 KB
testcase_21 AC 119 ms
55,452 KB
testcase_22 AC 116 ms
56,276 KB
testcase_23 AC 115 ms
55,684 KB
testcase_24 AC 116 ms
55,760 KB
testcase_25 AC 115 ms
55,708 KB
testcase_26 AC 115 ms
55,668 KB
testcase_27 AC 116 ms
56,032 KB
testcase_28 AC 114 ms
55,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.BigInteger;
import java.util.Scanner;

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

        if (N.mod(new BigInteger("4")).compareTo(BigInteger.ZERO) == 0) {
            if (N.mod(new BigInteger("100")).compareTo(BigInteger.ZERO) == 0) {
                if (N.mod(new BigInteger("400")).compareTo(BigInteger.ZERO) == 0) {
                    System.out.println("Yes");
                } else {
                    System.out.println("No");
                }
            } else {
                System.out.println("Yes");
            }
        } else {
            System.out.println("No");
        }
    }
}
0