113112024-08-08 12:35:25bzyEgykorúak (75 pont)cpp17Wrong answer 40/759ms660 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];
	int H[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
	for(int& p:P)cin>>p;
	int peter = 0;
	for(int i = 0;i<P[1]-1;i++){
		peter+= H[i];
	}
	if(P[0] %4 == 0 && P[1] > 2) peter++; 
	peter += P[2];
	for(int i = 0;i<n;i++){
		for(int j = 0;j<3;j++){
			cin>>R[i][j];
		}
		if(R[i][0] == P[0]) eg++;
		else if(abs(R[i][0]-P[0]) == 1){
			int random = 0;
			for(int j = 0;j<R[i][1]-1;j++) random+= H[j];
			random += R[i][2];
			if(R[i][0] %4 == 0 && R[i][1] > 2) random++;
			if(R[i][0] > P[0]){
				if(random <= peter) eg++;
			}
			else{
				if(peter<= random) eg++;
			}
		}
	}
	cout<<eg<<endl;
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base40/75
1Accepted0/03ms528 KiB
2Accepted0/09ms660 KiB
3Accepted5/53ms628 KiB
4Accepted5/52ms392 KiB
5Accepted5/53ms356 KiB
6Wrong answer0/53ms356 KiB
7Accepted5/53ms384 KiB
8Accepted5/53ms356 KiB
9Accepted5/53ms504 KiB
10Accepted5/54ms392 KiB
11Accepted5/54ms356 KiB
12Wrong answer0/54ms380 KiB
13Wrong answer0/56ms356 KiB
14Wrong answer0/56ms504 KiB
15Wrong answer0/57ms356 KiB
16Wrong answer0/58ms548 KiB
17Wrong answer0/58ms484 KiB