您的位置:首页 > 其它

POJ 1008 Maya Calendar

2015-07-20 15:08 344 查看
This problem is not very hard, just calm your head and pick up your pen, make the relationship of two kinds of calendar.

There are 365 days a year in Haab calendar, 260 days a year in Tzolkin calendar. First, just sum up the total number of days with Haab calendar, it's easy. Second, while the month and the day name of Tzolkin change in circle together, what we should do is
mod 13 to get month and mod 20 to get day name. That's all.

THERE IS ONLY ONE THING TO TAKE CARE: While total number of days exactly 260*X, we should decrease year number, for example:

Haab: 19. mac 0

Tzolink: 13 ahau 0 rather than 13 ahau 1.

THX for your reading, there is no Chinese typer, so just ignore my poor English.

Code is under the The comments section.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: