70182023-12-26 22:38:12xxxEgykorúak (75 pont)cpp11Accepted 75/756ms4628 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long

struct kor {
    int ev, honap, nap;
};

signed main() {
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int t = 1;
    //cin >> t;
    while(t--) {
        int n;
        cin >> n;
        n++;
        vector<kor> a(n);
        for(int i = 0; i < n; i++) {
            cin >> a[i].ev >> a[i].honap >> a[i].nap;
        }

        vector<int> eletkor(n);

        for(int i = 0; i < n; i++) {
            for(int j = 1950; j < a[i].ev; j++)
                if (j % 4 == 0) {
                    eletkor[i] += 366;
                } else {
                    eletkor[i] += 365;
                }

            if (a[i].honap == 2) eletkor[i] += 31;
            if (a[i].honap == 3) eletkor[i] += 59;
            if (a[i].honap == 4) eletkor[i] += 90;
            if (a[i].honap == 5) eletkor[i] += 120;
            if (a[i].honap == 6) eletkor[i] += 151;
            if (a[i].honap == 7) eletkor[i] += 181;
            if (a[i].honap == 8) eletkor[i] += 212;
            if (a[i].honap == 9) eletkor[i] += 243;
            if (a[i].honap == 10) eletkor[i] += 273;
            if (a[i].honap == 11) eletkor[i] += 304;
            if (a[i].honap == 12) eletkor[i] += 334;

            if (a[i].ev % 4 == 0 && a[i].honap > 2) eletkor[i]++;

            eletkor[i] += a[i].nap;

        }

        int ans = 0;

        for(int i = 1; i < n; i++) {
            if (abs(eletkor[i] - eletkor[0]) <= 365) {
                ans++;
            }
        }

        cout << ans << '\n';

    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1860 KiB
2Accepted0/06ms2480 KiB
3Accepted5/53ms2308 KiB
4Accepted5/53ms2316 KiB
5Accepted5/53ms2444 KiB
6Accepted5/53ms2808 KiB
7Accepted5/53ms2936 KiB
8Accepted5/53ms2932 KiB
9Accepted5/53ms3252 KiB
10Accepted5/53ms3256 KiB
11Accepted5/54ms3508 KiB
12Accepted5/54ms3756 KiB
13Accepted5/54ms3868 KiB
14Accepted5/54ms3876 KiB
15Accepted5/54ms4192 KiB
16Accepted5/54ms4272 KiB
17Accepted5/56ms4628 KiB