73772024-01-08 12:05:57madvirVilágnaptár (45 pont)cpp17Wrong answer 33/453ms3880 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;
                        cout << ho << " " << nap-1;
                    }
                    else {
                        cout << ho << " " << nap;
                    }
                }
            }
        }
    }
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base33/45
1Accepted0/03ms1880 KiB
2Accepted0/03ms2116 KiB
3Accepted0/03ms2356 KiB
4Accepted2/23ms2608 KiB
5Accepted2/23ms2700 KiB
6Wrong answer0/33ms2736 KiB
7Accepted3/33ms2952 KiB
8Accepted3/33ms3164 KiB
9Accepted3/33ms3252 KiB
10Wrong answer0/33ms3224 KiB
11Wrong answer0/33ms3344 KiB
12Accepted3/33ms3432 KiB
13Accepted3/33ms3436 KiB
14Accepted3/33ms3560 KiB
15Accepted3/33ms3636 KiB
16Accepted3/33ms3768 KiB
17Accepted3/33ms3848 KiB
18Accepted2/23ms3880 KiB
19Wrong answer0/33ms3848 KiB