21412022-12-22 11:59:32BttrngEgykorúak (75 pont)cpp11Wrong answer 60/759ms4308 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
base60/75
1Accepted0/03ms2000 KiB
2Accepted0/09ms2100 KiB
3Accepted5/52ms2348 KiB
4Accepted5/52ms2556 KiB
5Accepted5/52ms2756 KiB
6Accepted5/52ms2960 KiB
7Accepted5/52ms2996 KiB
8Accepted5/52ms3236 KiB
9Accepted5/52ms3180 KiB
10Wrong answer0/54ms3580 KiB
11Accepted5/54ms3628 KiB
12Accepted5/54ms3536 KiB
13Wrong answer0/54ms3660 KiB
14Accepted5/56ms3868 KiB
15Accepted5/57ms4072 KiB
16Wrong answer0/57ms4144 KiB
17Accepted5/58ms4308 KiB