77192024-01-10 17:31:18AblablablaVilágnaptár (45 pont)cpp17Accepted 45/453ms2848 KiB
#include <bits/stdc++.h>

using namespace std;

const vector<int> rendes = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365};
const vector<int> vilag = {0, 31, 61, 91, 122, 152, 182, 213, 243, 273, 304, 334, 364};

int main()
{
    int ev, honap, nap;
    cin >> ev >> honap >> nap;

    if(ev % 4 == 0 && honap == 7 && nap == 1){
        cout << ev << " 6 SZN\n";
        return 0;
    }

    if(honap == 12 && nap == 31){
        cout << ev << " 12 VN\n";
        return 0;
    }

    int osszNap = rendes[honap - 1] + nap;

    if(ev % 4 == 0 && honap > 2){
        osszNap++;
    }

    if(ev % 4 == 0 && honap >= 7){
        osszNap--;
    }

    int ujH = 0;
    while(osszNap > vilag[ujH]){
        ujH++;
    }

    cout << ev << " " << ujH << " " << osszNap - vilag[ujH - 1] << "\n";
}
SubtaskSumTestVerdictTimeMemory
base45/45
1Accepted0/03ms1816 KiB
2Accepted0/03ms2048 KiB
3Accepted0/03ms2408 KiB
4Accepted2/23ms2300 KiB
5Accepted2/23ms2412 KiB
6Accepted3/33ms2452 KiB
7Accepted3/32ms2460 KiB
8Accepted3/32ms2456 KiB
9Accepted3/32ms2580 KiB
10Accepted3/33ms2584 KiB
11Accepted3/32ms2712 KiB
12Accepted3/32ms2692 KiB
13Accepted3/32ms2688 KiB
14Accepted3/32ms2688 KiB
15Accepted3/32ms2688 KiB
16Accepted3/32ms2848 KiB
17Accepted3/32ms2704 KiB
18Accepted2/22ms2708 KiB
19Accepted3/32ms2708 KiB