結果

問題 No.779 Heisei
ユーザー yuasa0000yuasa0000
提出日時 2019-02-18 14:16:20
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 1,944 bytes
コンパイル時間 429 ms
コンパイル使用メモリ 53,168 KB
実行使用メモリ 16,824 KB
最終ジャッジ日時 2024-04-15 21:41:32
合計ジャッジ時間 4,867 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

int main(){
    int Y;
    int M;
    int D;
    
    while(true){
        std::cin >> Y;
        if(Y >= 1969 && Y <= 2038)break;
    }
    
    while(true){
        std::cin >> M;
        if(M >= 1 && M <= 12){
            if(Y == 1969 && M == 12)break;
            else if(Y == 2038 && M <= 4)break;
            else if(Y >= 1970 && Y <= 2037)break;
        }
    }
    
    while(true){
        std::cin >> D;
        switch(M){
            case 1:
            if(D >= 1 && D <= 31)break;
            break;
            
            case 2:
            if(D >= 1 && D <= 27)break;
            break;
            
            case 3:
            if(D >= 1 && D <= 31)break;
            break;
            
            case 4:
            if(D >= 1 && D <= 30)break;
            break;
            
            case 5:
            if(D >= 1 && D <= 31)break;
            break;
            
            case 6:
            if(D >= 1 && D <= 30)break;
            break;
            
            case 7:
            if(D >= 1 && D <= 31)break;
            break;
            
            case 8:
            if(D >= 1 && D <= 31)break;
            break;
            
            case 9:
            if(D >= 1 && D <= 30)break;
            break;
            
            case 10:
            if(D >= 1 && D <= 31)break;
            break;
            
            case 11:
            if(D >= 1 && D <= 30)break;
            break;
            
            case 12:
            if(D >= 1 && D <= 31)break;
            break;
        }
    }
    
    bool hantei;
    
    if(Y >= 1989 && Y <= 2019){
        if(Y == 1989 && M == 1 && M >= 8)hantei = true;
        if(Y == 2019 && M <= 4)hantei = true;
        if(Y >= 1990 && Y <= 2018)hantei = true;
        else hantei = false;
    }
    
    if(hantei == true)std::cout << "Yes" << std::endl;
    if(hantei == false)std::cout << "No" << std::endl;
    
    return 0;
}
0