摘要:
题目描述小学生A与B都是传说中智商高达250的优秀好青年,他们熟知高数与马克思主义哲学。按照一般的题目的尿性来看,接下来他们会玩一个游戏,而事实正是如此。。小学生A与小学生B在玩一个扔石子游戏,一堆石子n个,他们要把这些石子扔完。谁扔掉最后一个谁赢。一人一次,一次最多只能扔5个,不能不扔,而小学生智... 阅读全文
posted @ 2015-04-14 21:51
王皓月|r
阅读(151)
评论(0)
推荐(0)
摘要:
简单DP问题 dp[j] = max(olddp[j], olddp[j-1]) + n(当前数字)#include #include #include #include #define MAXR 1000intmax(int a, int b){ return a > b ? a : b;}int... 阅读全文
posted @ 2015-04-14 19:33
王皓月|r
阅读(252)
评论(0)
推荐(0)
摘要:
只需注意到质数肯定不是偶数,能节约枚举数目.#include #include #include #include int isprime(int n){ int i; if(n == 2) return 1; if(n%2 == 0) return 0; for(i=3; i*i <= n; ... 阅读全文
posted @ 2015-04-14 19:29
王皓月|r
阅读(233)
评论(0)
推荐(0)

浙公网安备 33010602011771号