77092024-01-10 14:17:19AblablablaVilágnaptár (45 pont)cpp17Wrong answer 21/453ms3892 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){
        osszNap++;
    }

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

    cout << ev << " " << ujH << " " << osszNap - vilag[ujH - 1] << "\n";
}
SubtaskSumTestVerdictTimeMemory
base21/45
1Accepted0/03ms1808 KiB
2Accepted0/03ms2084 KiB
3Accepted0/03ms2228 KiB
4Accepted2/23ms2400 KiB
5Accepted2/23ms2608 KiB
6Wrong answer0/33ms2848 KiB
7Wrong answer0/33ms3032 KiB
8Accepted3/33ms3268 KiB
9Wrong answer0/33ms3312 KiB
10Wrong answer0/32ms3400 KiB
11Wrong answer0/33ms3400 KiB
12Accepted3/33ms3472 KiB
13Wrong answer0/32ms3528 KiB
14Accepted3/33ms3536 KiB
15Wrong answer0/32ms3640 KiB
16Accepted3/33ms3892 KiB
17Wrong answer0/32ms3856 KiB
18Accepted2/22ms3860 KiB
19Accepted3/32ms3856 KiB