77172024-01-10 17:12:43AblablablaVilágnaptár (45 pont)cpp17Wrong answer 39/453ms3712 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
base39/45
1Accepted0/03ms1812 KiB
2Accepted0/03ms2052 KiB
3Accepted0/03ms2268 KiB
4Accepted2/23ms2332 KiB
5Accepted2/23ms2544 KiB
6Wrong answer0/32ms2476 KiB
7Accepted3/33ms2756 KiB
8Accepted3/33ms2936 KiB
9Accepted3/33ms2904 KiB
10Wrong answer0/32ms2904 KiB
11Accepted3/32ms2900 KiB
12Accepted3/33ms3036 KiB
13Accepted3/33ms3272 KiB
14Accepted3/32ms3288 KiB
15Accepted3/33ms3180 KiB
16Accepted3/32ms3180 KiB
17Accepted3/33ms3712 KiB
18Accepted2/23ms3528 KiB
19Accepted3/33ms3536 KiB