Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register
北京大学《ACM/ICPC大学生程序设计竞赛训练》暑期课面向全球招生!

Re:注意这组数据

Posted by themo at 2014-02-28 20:55:16 on Problem 1008
In Reply To:注意这组数据 Posted by:bergkamp at 2006-08-04 20:38:33
通常忘记考虑 260天,这个tzokin的年底最后一天
如果
t_year = total_day/260;
t_month = (total_day%260)%13;
if(t_month == 0) t_month =13;
t_day = (total_day%260)%20;
if(t_dy == 0) t_day=20;

但是这样无法处理total_day为260整数倍的情况
当total_day为260的整数倍时,会多出一年。
所以必须加上判断条件:if(total_day%260 == 0) t_year -= 1;

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator