結果

問題 No.9010 うるう年判定
ユーザー yagi2
提出日時 2017-04-21 17:02:28
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 742 bytes
コンパイル時間 2,351 ms
コンパイル使用メモリ 74,804 KB
実行使用メモリ 41,604 KB
最終ジャッジ日時 2024-07-20 05:07:47
合計ジャッジ時間 7,425 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 4
other WA * 25
権限があれば一括ダウンロードができます

ソースコード

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