222592026-01-14 18:57:07hunzombiVilágnaptár (45 pont)cpp17Wrong answer 4/452ms552 KiB
#include <bits/stdc++.h>
using namespace std;

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

    int normal[] = {0, 31,28,31,30,31,30,31,31,30,31,30,31};
    int new_cal[] = {0, 31,30,30,31,30,30,31,30,30,31,30,31};

    if (ev % 4 == 0) {
        normal[2] = 29;
        new_cal[6] = 31;
    }

    int day_in_year = 0;

    for (int i=0; i < honap; i++) {
        day_in_year += normal[i];
    }
    day_in_year += nap;

    int new_month = 1;

    while (day_in_year > new_cal[new_month]) day_in_year -= new_cal[new_month++];

    int new_day = day_in_year;

    cout << ev << ' ' << new_month << ' ';

    if (new_month == 6 && new_day == 31) {
        cout << "SZN";
    }
    if (new_month == 12 && new_day == 31) {
        cout << "VN";
    }
    cout << '\n';

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base4/45
1Wrong answer0/01ms492 KiB
2Accepted0/01ms512 KiB
3Accepted0/01ms336 KiB
4Wrong answer0/21ms512 KiB
5Accepted2/21ms512 KiB
6Wrong answer0/31ms316 KiB
7Wrong answer0/31ms316 KiB
8Wrong answer0/31ms552 KiB
9Wrong answer0/31ms316 KiB
10Wrong answer0/31ms316 KiB
11Wrong answer0/31ms332 KiB
12Wrong answer0/31ms316 KiB
13Wrong answer0/31ms508 KiB
14Wrong answer0/31ms316 KiB
15Wrong answer0/32ms316 KiB
16Wrong answer0/31ms396 KiB
17Wrong answer0/31ms316 KiB
18Accepted2/21ms316 KiB
19Wrong answer0/31ms316 KiB