21442022-12-22 14:48:58BttrngEgykorúak (75 pont)cpp11Accepted 75/759ms3840 KiB
#include<bits/stdc++.h>
using namespace std;

int hon[13]{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int np(int e, int h, int n){
    int mo=0;
    for(int i=1950; i<e; i++){
        if(i%4==0) mo+=366;
        else mo+=365;
    }
    for(int i=1; i<=h-1; i++) mo+=hon[i];
    mo+=n;
    if(e%4==0 && h>2) mo++;
    return mo;
}

int main(){
    int n;
    cin>>n;
    int pe, ph, pn;
    cin>>pe>>ph>>pn;
    int db=0;
    int pm=np(pe, ph, pn);
    for(int i=1; i<=n; i++){
        int a, b,c;
        cin>>a>>b>>c;
        int d=np(a, b, c);
        if(pm-d<=365 && pm-d>=-365) {
                db++;
        }
    }
    cout<<db;

}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms2008 KiB
2Accepted0/09ms2084 KiB
3Accepted5/52ms2292 KiB
4Accepted5/52ms2532 KiB
5Accepted5/52ms2740 KiB
6Accepted5/52ms2776 KiB
7Accepted5/52ms2784 KiB
8Accepted5/52ms2988 KiB
9Accepted5/52ms3232 KiB
10Accepted5/54ms3484 KiB
11Accepted5/54ms3640 KiB
12Accepted5/54ms3712 KiB
13Accepted5/54ms3716 KiB
14Accepted5/56ms3716 KiB
15Accepted5/57ms3716 KiB
16Accepted5/57ms3716 KiB
17Accepted5/58ms3840 KiB