結果
問題 | No.779 Heisei |
ユーザー |
![]() |
提出日時 | 2019-02-06 16:16:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 680 bytes |
コンパイル時間 | 693 ms |
コンパイル使用メモリ | 65,652 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-06 05:02:40 |
合計ジャッジ時間 | 1,563 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
#include<iostream> using namespace std; void uru(int year) { if(year%4==0 && year%100==0 && year%400==0){ cout<<"Yes"<<endl; } else { cout<<"No"<<endl;} } int main() { int Y,M,D; cin>>Y>>M>>D; if(1989<Y && Y<2019){ //平成 if(M==2&&D==29){ uru(Y); } //閏年判定 cout<<"Yes"<<endl; } else if(Y==1989){ if(M==1&&D<8){ cout<<"No"<<endl; } else { cout<<"Yes"<<endl; } } else if(Y==2019){ if(M>4){ cout<<"No"<<endl; } else { cout <<"Yes"<<endl;} } else { //西暦が平成でない cout<<"No"<<endl; } return 0; }