73742024-01-08 11:57:22madvirVilágnaptár (45 pont)cpp17Wrong answer 30/453ms3716 KiB
#include <iostream>

using namespace std;

int main()
{
    int ev, ho, nap;

    cin >> ev >> ho >> nap;

    cout << ev << " ";

    if(ho==12 && nap==31) cout << ho << " VN";
    else {
    if(ev%4==0) {
        if(ho==7 && nap==1) {
            cout << 6 << " SZN";
        }
        if(ho==3) {
            if(nap==1) {
                cout << ho-1 << " " << 30;
            }
            else {
                if(ho==5 || ho==8) {
                    if(nap==1) cout << ho-1 << 31;
                    else cout << ho << " " << nap-1;
                }
                else cout << ho << " " << nap;
            }
        }
        else {

        }
    }
    else {
        if(ho==3) {
            if(nap==1 || nap==2) {
                cout << ho-1 << " " << 28+nap;
            }
            else {
                    cout << ho << " " << nap-2;
            }
        }
        else {
            if(ho==5) {
                if(nap==1 || nap==2) {
                    cout << ho-1 << " " << 29+nap;
                }
                else {
                    cout << ho << " " << nap-2;
                }
            }
            else {
                if(ho==4 || ho==6 || ho==7) {
                    if(nap==1) cout << ho-1 << " " << 30;
                    else cout << ho << " " << nap-1;
                }
                else {
                    if(ho==8) {
                        if(nap==1) cout << ho-1 << " " << 31;
                    }
                    else {
                        cout << ho << " " << nap;
                    }
                }
            }
        }
    }
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/45
1Accepted0/03ms1872 KiB
2Accepted0/03ms2124 KiB
3Accepted0/03ms2336 KiB
4Accepted2/23ms2488 KiB
5Accepted2/23ms2700 KiB
6Wrong answer0/33ms2952 KiB
7Accepted3/33ms3164 KiB
8Accepted3/33ms3248 KiB
9Accepted3/33ms3212 KiB
10Wrong answer0/33ms3328 KiB
11Wrong answer0/33ms3572 KiB
12Accepted3/33ms3420 KiB
13Accepted3/33ms3420 KiB
14Accepted3/33ms3452 KiB
15Wrong answer0/33ms3500 KiB
16Accepted3/33ms3500 KiB
17Accepted3/33ms3624 KiB
18Accepted2/23ms3716 KiB
19Wrong answer0/33ms3716 KiB