7702022-01-10 07:50:36kidesoEgykorúak (75 pont)cpp11Accepted 75/758ms2464 KiB
#include <iostream>

#define ll long long
using namespace std;

ll N, ev, honap, nap, db;
ll x[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };

ll szamol(ll e, ll h, ll n)
{
	ll k = e * 365 + e / 4 + x[h - 1] + n;
	if (e % 4 == 0 && h <= 2) --k;
	return k;
}

int main()
{
	cin >> N;
	cin >> ev >> honap >> nap;

	for (ll i = 2; i <= 12; ++i)
		x[i] += x[i - 1];

	ll p = szamol(ev, honap, nap);

	db = 0;
	for (ll i = 1; i <= N; ++i)
	{
		cin >> ev >> honap >> nap;
		ll k = szamol(ev, honap, nap);
	
		if (abs(p - k) <= 365) ++db;
	}

	cout << db << '\n';
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/02ms1824 KiB
2Accepted0/08ms2016 KiB
3Accepted5/51ms2020 KiB
4Accepted5/51ms2016 KiB
5Accepted5/51ms2028 KiB
6Accepted5/51ms2024 KiB
7Accepted5/51ms2028 KiB
8Accepted5/51ms2040 KiB
9Accepted5/51ms2036 KiB
10Accepted5/52ms2052 KiB
11Accepted5/53ms2084 KiB
12Accepted5/53ms2108 KiB
13Accepted5/53ms2136 KiB
14Accepted5/54ms2180 KiB
15Accepted5/54ms2236 KiB
16Accepted5/54ms2364 KiB
17Accepted5/57ms2464 KiB