hdu 1079 Calendar Game



2 operations, day + 1, or month + 1, (except for a few special dates) can change the parity of month + day,
and target 11.4, month + day is odd, so as long as the month + day of the starting date An even number is possible to win.
And for two special dates (9.30, 11.30), although the month + day is odd, the next step can still get an odd number.

#include<stdio.h>
using namespace std;


int main(){
	int t;
	int y,m,d;
	scanf("%d",&t);
	while(t--){
		scanf("%d%d%d",&y,&m,&d);		
		if((m+d)%2==0||((m==9||m==11)&&d==30))
		printf("YES\n");
		else printf("NO\n");	
	}
	return 0;
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325888659&siteId=291194637