73522024-01-08 09:39:05szabelrVilágnaptár (45 pont)cpp17Wrong answer 39/453ms3808 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/03ms1744 KiB
2Accepted0/03ms1908 KiB
3Accepted0/03ms2272 KiB
4Accepted2/23ms2324 KiB
5Accepted2/23ms2572 KiB
6Accepted3/33ms2656 KiB
7Accepted3/33ms2720 KiB
8Accepted3/33ms2928 KiB
9Accepted3/33ms3140 KiB
10Accepted3/33ms3220 KiB
11Accepted3/33ms3236 KiB
12Accepted3/33ms3348 KiB
13Accepted3/33ms3600 KiB
14Accepted3/33ms3568 KiB
15Accepted3/33ms3680 KiB
16Accepted3/33ms3692 KiB
17Wrong answer0/33ms3772 KiB
18Accepted2/23ms3808 KiB
19Wrong answer0/33ms3776 KiB