#include <stdio.h>
int main()
{
int n, year, month, day;
scanf("%d", &n);
while (n--) {
scanf("%d%d%d", &year, &month, &day);
if (month == 9 && day == 30) {
printf("YES\n");
}
else if (month == 11 && day == 30)
printf("YES\n");
else if ((month + day) % 2 == 0)
printf("YES\n");
else
printf("NO\n");
}
return 0;
}
由题意知无论是month加一还是day加一,month+day的奇偶性总是在变,除了2.28,9.30,11.30会改变奇偶性。初始日期month+day为偶数,亚当每次的日期为奇数,夏娃的日期为偶数,11+4=15为奇数,亚当胜。日期9.30,11.30亚当也胜。
ZOJ1024-Calendar Game
最新推荐文章于 2020-02-07 11:05:28 发布