113122024-08-08 12:45:49bzyEgykorúak (75 pont)cpp17Wrong answer 65/7510ms632 KiB
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int eg = 0;
	vector<int> P(3);
	int R[n][3] = {0};
	int H[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
	for(int& p:P)cin>>p;
	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++){
		for(int j = 0;j<3;j++){
			cin>>R[i][j];
		}
		int random = 0;
		for(int j = 1950;j<R[i][0];j++){
			if(j%4==0) random++;
			random += 365;
		}
		for(int j = 0;j<R[i][1];j++){
			random += H[j];
		}
		random += R[i][2];
		if(R[i][0]%4==0 && R[i][1] > 2) random ++;
		if(abs(peter-random) <= 365) eg++;
	}
	cout<<eg<<endl;
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base65/75
1Accepted0/03ms500 KiB
2Accepted0/010ms544 KiB
3Accepted5/53ms484 KiB
4Accepted5/53ms384 KiB
5Accepted5/53ms504 KiB
6Accepted5/53ms492 KiB
7Accepted5/53ms632 KiB
8Accepted5/52ms500 KiB
9Accepted5/53ms356 KiB
10Accepted5/54ms516 KiB
11Accepted5/54ms364 KiB
12Accepted5/54ms440 KiB
13Accepted5/56ms356 KiB
14Accepted5/58ms424 KiB
15Wrong answer0/57ms356 KiB
16Wrong answer0/58ms348 KiB
17Accepted5/58ms376 KiB