113242024-08-08 17:33:25bzyEgykorúak (75 pont)cpp17Accepted 75/7510ms612 KiB
#include <bits/stdc++.h>
using namespace std;
int H[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
int calc(int y,int m,int d)
{
	int D = d;
	for(int i = 1950; i<y; i++){
		if(i%4 == 0) D++;
		D += 365;
	}
	for(int i = 1; i< m; i++){
		D += H[i];
	}
	if(y%4 == 0 && m > 2) D++;
	return D;
}
int main()
{
	int n;
	cin >> n;
	int eg = 0;
	int P[3];
	cin >> P[0] >> P[1] >> P[2];
	int peter = calc(P[0],P[1],P[2]);
	for(int i = 0; i < n; i++){
		int ev; int ho; int nap;
		cin >> ev >> ho >> nap;
		int random = calc(ev, ho, nap);
		if(max(peter, random) - min(peter,random) <= 365) eg++;
	}
	cout<<eg;
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms356 KiB
2Accepted0/010ms300 KiB
3Accepted5/53ms504 KiB
4Accepted5/53ms308 KiB
5Accepted5/53ms376 KiB
6Accepted5/52ms356 KiB
7Accepted5/53ms356 KiB
8Accepted5/53ms384 KiB
9Accepted5/53ms384 KiB
10Accepted5/54ms228 KiB
11Accepted5/54ms500 KiB
12Accepted5/54ms492 KiB
13Accepted5/56ms356 KiB
14Accepted5/57ms376 KiB
15Accepted5/58ms612 KiB
16Accepted5/58ms356 KiB
17Accepted5/59ms376 KiB