POJ 1082 Calendar Game】的更多相关文章

Adam and Eve enter this year's ACM International Collegiate Programming Contest. Last night, they played the Calendar Game, in celebration of this contest. This game consists of the dates from January 1, 1900 to November 4, 2001, the contest day. The…
传送门 以下复制自此处:http://www.xuebuyuan.com/2028180.html 博弈论题目可以用寻找必败状态的方法解决. 第一个必败状态是2001.11.04.由此可以推出其他任何时间的状态.对于除2001.11.04外的其他任何时间,present状态是由能移动到的下两个next状态决定的(当然有些时间只有一个next状态),比如1924.12.19的状态是由1924.12.20和1925.01.19两个状态决定.如果两个next状态中有一个必败状态,则present状态为…
万能的discuss.只需要月份和天数同奇同偶即可,9月30和11月30例外 #include <iostream> #include <cstdio> using namespace std; int main() { //freopen("in.txt","r",stdin); int n; scanf("%d",&n); while(n--) { int year,month,day; scanf("…
[题目链接] http://poj.org/problem?id=1082 [算法] 对于每种状态,要么必胜,要么必败 记忆化搜索即可 [代码] #include <algorithm> #include <bitset> #include <cctype> #include <cerrno> #include <clocale> #include <cmath> #include <complex> #include &…
http://poj.org/problem?id=1008 Maya Calendar Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 64607 Accepted: 19908 Description During his last sabbatical, professor M. A. Ya made a surprising discovery about the old Maya calendar. From an…
Calendar Game Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2519    Accepted Submission(s): 1438 Problem Description Adam and Eve enter this year's ACM International Collegiate Programming Co…
Calendar Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 12546   Accepted: 4547 Description A calendar is a system for measuring time, from hours and minutes, to months and days, and finally to years and centuries. The terms of hour, day…
刚开始一直WA,才发现原来代码中两处减去年份.月份的天数的判断条件用的是>=,虽然最后考虑n=0要退回一天的情况,但还是WA.后来改成>的条件判断,省去了考虑n=0的麻烦,AC. 此题无非就是考虑平年.闰年,月底月末,年底年末的情况. #include <iostream> #include <string.h> #include <stdio.h> #include <cstring> #include <stdlib.h> usi…
#include <iostream> using namespace std; int main() { //freopen("acm.acm","r",stdin); int a; int b; int c; int test; cin>>test; while(test --) { cin>>a>>b>>c; && c == ) || (b == && c == ))…
POJ 排序的思想就是根据选取范围的题目的totalSubmittedNumber和totalAcceptedNumber计算一个avgAcceptRate. 每一道题都有一个value,value = acceptedNumber / avgAcceptRate + submittedNumber. 这里用到avgAcceptedRate的原因是考虑到通过的数量站的权重可能比提交的数量占更大的权重,所以给acceptedNumber乘上了一个因子. 当然计算value还有别的方法,比如POJ上…