70162023-12-26 22:17:07xxxEgykorúak (75 pont)cpp11Wrong answer 40/756ms3736 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;
            a[i].ev -= 1948;
        }

        vector<int> eletkor(n);

        for(int i = 0; i < n; i++) {
            eletkor[i] += a[i].ev * 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
base40/75
1Accepted0/03ms1824 KiB
2Accepted0/06ms2524 KiB
3Accepted5/53ms2340 KiB
4Accepted5/53ms2556 KiB
5Accepted5/53ms2596 KiB
6Wrong answer0/53ms2524 KiB
7Accepted5/53ms2656 KiB
8Accepted5/53ms2744 KiB
9Accepted5/53ms2976 KiB
10Accepted5/53ms3016 KiB
11Accepted5/53ms3012 KiB
12Wrong answer0/54ms3344 KiB
13Wrong answer0/54ms3628 KiB
14Wrong answer0/54ms3716 KiB
15Wrong answer0/54ms3596 KiB
16Wrong answer0/54ms3736 KiB
17Wrong answer0/54ms3708 KiB