72992024-01-06 15:17:18szabelrVilágnaptár (45 pont)cpp17Wrong answer 39/453ms3908 KiB
#include <iostream>
using namespace std;
int main()
{
    int ev, honap, nap;
    cin >> ev >> honap >> nap;
    if (ev % 4 != 0)
    {
        if (honap == 1 or honap == 9 or honap == 10 or honap == 11 or honap == 2)
            cout << ev << " " << honap << " " << nap;
        if (honap == 12 and nap < 31)
            cout << ev << " " << honap << " " << nap;
        if (honap == 12 and nap == 31)
            cout << ev << " " << honap << " " << "VN";
        if (honap == 3 and nap <= 2)
            cout << ev << " " << honap - 1 << " " << 28 + nap;
        if (honap == 3 and nap > 2)
            cout << ev << " " << honap << " " << nap - 2;
        if (honap == 4 and nap == 1)
            cout << ev << " " << honap - 1 << " " << "31";
        if (honap == 4 and nap > 1)
            cout << ev << " " << honap << " " << nap - 1;
        if (honap == 5 and nap <= 2)
            cout << ev << " " << honap - 1 << " " << 29 + nap;
        if (honap == 5 and nap > 2)
            cout << ev << " " << honap << " " << nap - 2;
        if (honap == 6 and nap == 1)
            cout << ev << " " << honap - 1 << " " << "31";
        if (honap == 6 and nap >= 1)
            cout << ev << " " << honap << " " << nap - 1;
        if (honap == 7 and nap == 1)
            cout << ev << " " << honap - 1 << " " << "30";
        if (honap == 7 and nap > 1)
            cout << ev << " " << honap << " " << nap - 1;
        if (honap == 8 and nap == 1)
            cout << ev << " " << honap - 1 << " " << "31";
        if (honap == 8 and nap > 1)
            cout << ev << " " << honap << " " << nap - 1;
    }
    if (ev % 4 == 0)
    {
        if (honap == 1 or honap == 9 or honap == 10 or honap == 11 or honap == 2)
            cout << ev << " " << honap << " " << nap;
        if (honap == 12 and nap < 31)
            cout << ev << " " << honap << " " << nap;
        if (honap == 12 and nap == 31)
            cout << ev << " " << honap << " " << "VN";
        if (honap == 3 and nap <= 1)
            cout << ev << " " << honap - 1 << " " << 29 + nap;
        if (honap == 3 and nap > 1)
            cout << ev << " " << honap << " " << nap - 1;
        if (honap == 4 and nap == 1)
            cout << ev << " " << honap - 1 << " " << "31";
        if (honap == 4 and nap > 1)
            cout << ev << " " << honap << " " << nap ;
        if (honap == 5 and nap == 1)
            cout << ev << " " << honap - 1 << " " << "31";
        if (honap == 5 and nap > 2)
            cout << ev << " " << honap << " " << nap - 1;
        if (honap == 6 and nap >= 1)
            cout << ev << " " << honap << " " << nap ;
        if (honap == 7 and nap == 1)
            cout << ev << " " << honap - 1 << " " << "SZN";
        if (honap == 7 and nap > 1)
            cout << ev << " " << honap << " " << nap - 1;
        if (honap == 8 and nap == 1)
            cout << ev << " " << honap - 1 << " " << "31";
        if (honap == 8 and nap > 1)
            cout << ev << " " << honap << " " << nap - 1;
    }
}
SubtaskSumTestVerdictTimeMemory
base39/45
1Accepted0/03ms1880 KiB
2Accepted0/03ms2112 KiB
3Accepted0/03ms2220 KiB
4Accepted2/22ms2248 KiB
5Accepted2/23ms2504 KiB
6Accepted3/33ms2624 KiB
7Accepted3/33ms2748 KiB
8Accepted3/33ms2828 KiB
9Accepted3/33ms2952 KiB
10Accepted3/33ms3176 KiB
11Accepted3/33ms3400 KiB
12Accepted3/33ms3464 KiB
13Accepted3/33ms3588 KiB
14Accepted3/33ms3796 KiB
15Accepted3/33ms3872 KiB
16Accepted3/33ms3880 KiB
17Wrong answer0/33ms3872 KiB
18Accepted2/23ms3872 KiB
19Wrong answer0/33ms3908 KiB