77162024-01-10 17:11:54AblablablaVilágnaptár (45 pont)cpp17Wrong answer 42/453ms3908 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/* || (honap == 2 && nap == 29)*/)){
        osszNap++;
    }

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

    cout << ev << " " << ujH << " " << osszNap - vilag[ujH - 1] << "\n";
}
SubtaskSumTestVerdictTimeMemory
base42/45
1Accepted0/03ms1832 KiB
2Accepted0/03ms1980 KiB
3Accepted0/03ms2468 KiB
4Accepted2/23ms2484 KiB
5Accepted2/23ms2636 KiB
6Accepted3/33ms2848 KiB
7Accepted3/33ms2956 KiB
8Accepted3/32ms3020 KiB
9Accepted3/33ms2940 KiB
10Wrong answer0/33ms2932 KiB
11Accepted3/33ms3188 KiB
12Accepted3/33ms3392 KiB
13Accepted3/32ms3516 KiB
14Accepted3/33ms3644 KiB
15Accepted3/33ms3676 KiB
16Accepted3/33ms3764 KiB
17Accepted3/33ms3768 KiB
18Accepted2/23ms3768 KiB
19Accepted3/33ms3908 KiB