結果

問題 No.779 Heisei
ユーザー htensai
提出日時 2019-12-07 12:17:25
言語 Java
(openjdk 23)
結果
AC  
実行時間 159 ms / 1,000 ms
コード長 565 bytes
コンパイル時間 2,608 ms
コンパイル使用メモリ 74,328 KB
実行使用メモリ 41,388 KB
最終ジャッジ日時 2024-12-25 03:01:58
合計ジャッジ時間 7,252 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
 	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int y = sc.nextInt();
		int m = sc.nextInt();
		int d = sc.nextInt();
		String ans;
		if (y < 1989 || y > 2019) {
		    ans = "No";
		} else if (y == 1989) {
		    if (m == 1 && d < 8) {
		        ans = "No";
		    } else {
		        ans = "Yes";
		    }
		} else if (y == 2019) {
		    if (m <= 4) {
		        ans = "Yes";
		    } else {
		        ans = "No";
		    }
		} else {
		    ans = "Yes";
		}
	    System.out.println(ans);
   }
}
0