101002024-03-26 19:39:05VargusVilágnaptár (45 pont)cpp17Accepted 45/453ms3148 KiB
#include <iostream>
#include <queue>
#define ll long long

using namespace std;

int main()
{
    vector <ll> igazi = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 };
    vector <ll> vilag = { 0, 31, 61, 91, 122, 152, 182, 213, 243, 273, 304, 334, 364 };
    ll ev, ho, nap;
    cin >> ev >> ho >> nap;
    if (ev % 4 == 0 && ho == 7 && nap == 1)
    {
        cout << ev << " 6 SZN";
        return 0;
    }
    else if (ho == 12 && nap == 31)
    {
        cout << ev << " 12 VN";
        return 0;
    }
    else
    {
        ll ujnap = igazi[ho - 1] + nap;
        if (ev % 4 == 0 && ho > 2)
        {
            ++ujnap;
        }
        if (ev % 4 == 0 && ho >= 7)
        {
            --ujnap;
        }
        ll ujho = 0;
        while (ujnap > vilag[ujho])
        {
            ++ujho;
        }
        cout << ev << " " << ujho << " " << ujnap - vilag[ujho - 1];
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base45/45
1Accepted0/03ms1816 KiB
2Accepted0/03ms2052 KiB
3Accepted0/02ms2136 KiB
4Accepted2/22ms2140 KiB
5Accepted2/23ms2120 KiB
6Accepted3/33ms2320 KiB
7Accepted3/32ms2440 KiB
8Accepted3/33ms2576 KiB
9Accepted3/33ms2776 KiB
10Accepted3/32ms2856 KiB
11Accepted3/33ms2980 KiB
12Accepted3/33ms3068 KiB
13Accepted3/32ms3036 KiB
14Accepted3/32ms3032 KiB
15Accepted3/32ms3036 KiB
16Accepted3/32ms3040 KiB
17Accepted3/32ms3148 KiB
18Accepted2/22ms3036 KiB
19Accepted3/32ms3032 KiB