7682022-01-10 07:37:47kidesoEgykorúak (75 pont)cpp11Wrong answer 20/757ms2460 KiB
#include <iostream>

using namespace std;

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

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

int main()
{
	cin >> N;
	cin >> ev >> honap >> nap;
	int p = szamol(ev, honap, nap);

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

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

	cout << db << '\n';
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base20/75
1Accepted0/02ms1804 KiB
2Wrong answer0/07ms1996 KiB
3Accepted5/52ms2012 KiB
4Accepted5/51ms2004 KiB
5Wrong answer0/51ms2016 KiB
6Accepted5/51ms2020 KiB
7Wrong answer0/51ms2016 KiB
8Wrong answer0/51ms2036 KiB
9Accepted5/51ms2032 KiB
10Wrong answer0/53ms2048 KiB
11Wrong answer0/52ms2080 KiB
12Wrong answer0/53ms2104 KiB
13Wrong answer0/54ms2168 KiB
14Wrong answer0/54ms2216 KiB
15Wrong answer0/54ms2228 KiB
16Wrong answer0/56ms2316 KiB
17Wrong answer0/57ms2460 KiB