113162024-08-08 13:11:30bzyEgykorúak (75 pont)cpp17Wrong answer 65/759ms508 KiB
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int eg = 0;
	vector<int> P(3);
	int H[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
	cin>>P[0]>>P[1]>>P[2];
	int peter = 0;
	for(int i = 1950;i<P[0];i++){
		if(i%4==0) peter+= 366;
		else peter += 365;
	}
	for(int i = 1;i<P[1];i++){
		peter += H[i];
	}
	peter += P[2];

	if(P[0] % 4 ==  0 && P[2] > 2) peter++;

	for(int i = 0;i<n;i++){
		int rev; int rh; int rnap;
		cin>>rev>>rh>>rnap;
		int random = 0;
		for(int j = 1950; j<rev;j++){
			if(j%4 == 0) random+= 366;
			else random += 365;
		}
		for(int j = 1;j<rh;j++){
			random += H[j];
		}
		random += rnap;
		if(rev%4 == 0 && rh > 2) random++;
		if(max(peter,random)-min(peter,random) <= 365) eg++;
	}
	cout<<eg;
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base65/75
1Accepted0/03ms504 KiB
2Accepted0/09ms388 KiB
3Accepted5/53ms504 KiB
4Accepted5/52ms348 KiB
5Accepted5/52ms356 KiB
6Accepted5/53ms504 KiB
7Accepted5/52ms356 KiB
8Accepted5/53ms508 KiB
9Accepted5/53ms504 KiB
10Accepted5/54ms384 KiB
11Accepted5/54ms384 KiB
12Accepted5/54ms376 KiB
13Accepted5/56ms376 KiB
14Accepted5/57ms256 KiB
15Wrong answer0/57ms504 KiB
16Wrong answer0/58ms268 KiB
17Accepted5/59ms504 KiB