結果

問題 No.9010 うるう年判定
ユーザー yagi2
提出日時 2017-04-21 17:03:16
言語 Java
(openjdk 23)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 742 bytes
コンパイル時間 2,082 ms
コンパイル使用メモリ 74,948 KB
実行使用メモリ 54,448 KB
最終ジャッジ日時 2024-06-22 01:07:24
合計ジャッジ時間 5,815 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 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