113152024-08-08 13:05:59bzyEgykorúak (75 pont)cpp17Wrong answer 65/7510ms524 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++;
		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++;
			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/03ms512 KiB
2Accepted0/010ms492 KiB
3Accepted5/53ms504 KiB
4Accepted5/53ms392 KiB
5Accepted5/53ms412 KiB
6Accepted5/53ms384 KiB
7Accepted5/53ms408 KiB
8Accepted5/53ms384 KiB
9Accepted5/53ms356 KiB
10Accepted5/54ms356 KiB
11Accepted5/54ms504 KiB
12Accepted5/54ms524 KiB
13Accepted5/56ms356 KiB
14Accepted5/57ms356 KiB
15Wrong answer0/57ms284 KiB
16Wrong answer0/58ms236 KiB
17Accepted5/58ms256 KiB