77652024-01-11 09:10:34csaron71Világnaptár (45 pont)cpp17Wrong answer 42/453ms4044 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int ev, honap, nap;
    cin >> ev >> honap >> nap;
    if (ev%4==0) {
        // szokoev
        if (honap==1 || honap==2) {
            cout << ev << " " << honap << " " << nap;
        }
        else if  (honap==3) {
            if (nap==1) {
                cout << ev << " 2 30";
            }
            else {
                cout << ev << " 3 " << nap-1;
            }
        }
        else if (honap==4) {
            cout << ev << " 4 " << nap-1;

        }
        else if (honap==5) {
            if (nap==1) {
                cout << ev << " 4 31";
            }
            else {
                cout << ev << " 5 " << nap-1;
            }
        }
        else if (honap==6) {
            cout << ev << " 6 " << nap;

        }
        else if (honap==7) {
            if (nap==1) {
                cout << ev << " 6 SZN";
            }
            else {
                cout << ev << " 7 " << nap-1;
            }

        }
        else if (honap==8) {
            if (nap==1) {
                cout << ev << " 7 31";
            }
            else {
                cout << ev << " 8 " << nap-1;
            }

        }
        else if (honap==12 && nap==31) {
            cout << ev << " 12 VN";
        }
        else {
            cout << ev << " " << honap << " " << nap;

        }

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

        }
        else if (honap==7) {
            if (nap==1) {
                cout << ev << " 6 30";
            }
            else {
                cout << ev << " 7 " << nap-1;
            }

        }
        else if (honap==8) {
            if (nap==1) {
                cout << ev << " 7 31";
            }
            else {
                cout << ev << " 8 " << nap-1;
            }

        }
        else if (honap==12 && nap==31) {
            cout << ev << " 12 VN";
        }
        else {
            cout << ev << " " << honap << " " << nap;

        }

    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base42/45
1Accepted0/03ms1876 KiB
2Accepted0/03ms2064 KiB
3Accepted0/03ms2280 KiB
4Accepted2/23ms2504 KiB
5Accepted2/23ms2744 KiB
6Accepted3/33ms2916 KiB
7Accepted3/33ms2996 KiB
8Accepted3/33ms3128 KiB
9Accepted3/33ms3392 KiB
10Accepted3/33ms3444 KiB
11Accepted3/33ms3788 KiB
12Accepted3/33ms4044 KiB
13Accepted3/33ms3996 KiB
14Accepted3/33ms3744 KiB
15Accepted3/33ms3748 KiB
16Accepted3/33ms3820 KiB
17Accepted3/33ms3820 KiB
18Accepted2/23ms3964 KiB
19Wrong answer0/33ms3952 KiB