7692022-01-10 07:41:07kidesoEgykorúak (75 pont)cpp11Wrong answer 40/757ms2452 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;
	ll p = szamol(ev, honap, nap);

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

	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
base40/75
1Accepted0/02ms1800 KiB
2Wrong answer0/07ms2004 KiB
3Accepted5/51ms2000 KiB
4Accepted5/51ms2020 KiB
5Wrong answer0/51ms2016 KiB
6Accepted5/52ms2012 KiB
7Wrong answer0/51ms2028 KiB
8Wrong answer0/51ms2020 KiB
9Accepted5/51ms2032 KiB
10Accepted5/53ms2048 KiB
11Wrong answer0/53ms2064 KiB
12Wrong answer0/53ms2088 KiB
13Accepted5/53ms2132 KiB
14Wrong answer0/54ms2168 KiB
15Accepted5/54ms2224 KiB
16Accepted5/54ms2360 KiB
17Wrong answer0/57ms2452 KiB