Edward, the headmaster of the Marjar University, is very busy every day and always forgets the date. There was one day Edward suddenly found that if Monday was the 1st, 11th or 21st day of that month, he could remember the date clearly in that week.…
题目链接: D - The Lucky Week ZOJ - 3939 题目大意:幸运的星期指,星期一为每个月的1 or 11 or 21号.给出第一个幸运星期的时间,问从当前的日起开始.第n个的日期. 具体思路:我们通过打表可以发现,每隔400年,当前的这一天的星期和400年后的是相同的.所以我们先求出一个400年有多少个幸运的天数(1600-1999),然后判断当前的年份如果以1600年开始的话,往后n个幸运日是多少,然后再做差以原来的起点输出就可以了. AC代码: #include<bi…
Calculation Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2272 Accepted Submission(s): 536 Problem Description Assume that f(0) = 1 and 0^0=1. f(n) = (n%10)^f(n/10) for all n bigger than ze…
Period Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 14653 Accepted: 6965 Description For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the…