75612024-01-09 17:09:16AblablablaTükörtojás (75 pont)cpp17Wrong answer 5/754ms3332 KiB
#include <bits/stdc++.h>

using namespace std;

vector<int> honapok = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365};

int main()
{
    int n;
    cin >> n;

    int peti = 0;
    int ev, honap, nap;
    cin >> ev >> honap >> nap;
    ev -= 1948;
    if(ev % 4 == 0){
        peti += ev / 4 - (honap <= 2 ? 1 : 0);
    } else{
        peti += ev / 4;
    }

    peti += 365 * ev + honapok[honap - 1] + nap;

    int valasz = 0;

    for(int i = 0; i < n; i++){
        int akt = 0;
        cin >> ev >> honap >> nap;

        ev -= 1948;
        if(ev % 4 == 0){
            akt += ev / 4 - (honap <= 2 ? 1 : 0);
        } else{
            akt += ev / 4;
        }

        akt += 365 * ev + honapok[honap - 1] + nap;

        if(abs(peti - akt) <= 365){
            valasz++;
        }
    }

    cout << valasz << "\n";
}
SubtaskSumTestVerdictTimeMemory
base5/75
1Wrong answer0/03ms2084 KiB
2Wrong answer0/04ms2144 KiB
3Accepted5/53ms2296 KiB
4Wrong answer0/53ms2464 KiB
5Wrong answer0/52ms2556 KiB
6Wrong answer0/53ms2640 KiB
7Wrong answer0/52ms2704 KiB
8Wrong answer0/53ms2956 KiB
9Wrong answer0/53ms3056 KiB
10Wrong answer0/53ms3276 KiB
11Wrong answer0/53ms3316 KiB
12Wrong answer0/54ms3272 KiB
13Wrong answer0/54ms3276 KiB
14Wrong answer0/54ms3272 KiB
15Wrong answer0/54ms3268 KiB
16Wrong answer0/54ms3268 KiB
17Wrong answer0/54ms3332 KiB