79742024-01-12 09:34:41BotiVilágnaptár (45 pont)cpp17Wrong answer 42/453ms4004 KiB
#include <bits/stdc++.h>

using namespace std;

vector<int> napok = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
vector<int> napok1 = {0, 31, 61, 91, 122, 152, 182, 213, 243, 273, 304, 334, 366};

int main()
{
    int y, m, d;
    cin >> y >> m >> d;
    int d1 = napok[m -1] + d;
    if (y % 4 == 0 && m > 2)
        d1++;
    int m1 = 12;
    for (int i = 1; i <= 12; i++)
    {
        if (napok1[i] >= d1)
        {
            m1 = i;
            d1 -= napok1[i -1];
            i = 12;
        }
    }
    if (m1 == 7 && d1 == 1)
        cout << y << " 6 SZN";
    else if (m1 == 12 && d1 == 31)
        cout << y << " 12 VN";
    else
        cout << y << " " << m1 << " " << d1;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base42/45
1Accepted0/03ms1808 KiB
2Accepted0/03ms2056 KiB
3Accepted0/03ms2300 KiB
4Accepted2/23ms2512 KiB
5Accepted2/23ms2764 KiB
6Accepted3/33ms2708 KiB
7Accepted3/33ms2960 KiB
8Accepted3/33ms2936 KiB
9Accepted3/33ms3040 KiB
10Wrong answer0/33ms3260 KiB
11Accepted3/33ms3376 KiB
12Accepted3/33ms3508 KiB
13Accepted3/32ms3564 KiB
14Accepted3/33ms3576 KiB
15Accepted3/33ms3700 KiB
16Accepted3/33ms3788 KiB
17Accepted3/33ms3944 KiB
18Accepted2/23ms3868 KiB
19Accepted3/33ms4004 KiB