上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 38 下一页
2015年2月2日
摘要: 题目大意就是求 a^x = b(mod c) 中的x用一般的baby step giant step 算法会超时这里参考的是http://hi.baidu.com/aekdycoin/item/236937318413c680c2cf29d4map平衡树查找值 1 #include 2 #incl... 阅读全文
posted @ 2015-02-02 01:20 Love风吟 阅读(411) 评论(0) 推荐(0) 编辑
2015年1月29日
摘要: 题目大意:求出我们可以通过求∑(1#include #include using namespace std;#define ll long longconst int N = 4000010;int prime[N] , phi[N] , tot;bool vis[N];void get_phi(... 阅读全文
posted @ 2015-01-29 21:53 Love风吟 阅读(110) 评论(0) 推荐(0) 编辑
2015年1月28日
摘要: 题目大意:每次可以翻1个或者2个或者3个硬币,但要保证最右边的那个硬币是正面的,直到不能操作为输,这题目还有说因为主人公感情混乱可能描述不清会有重复的硬币说出,所以要去重这是一个Mock Turtles型翻硬币游戏下面是对这个类型游戏的讲解约束条件6:每次可以翻动一个、二个或三个硬币。(Mock T... 阅读全文
posted @ 2015-01-28 22:22 Love风吟 阅读(512) 评论(0) 推荐(0) 编辑
摘要: 1.HDU 1114Piggy Bank一道简单的背包问题#include #include #include using namespace std;#define ll long longconst int N = 10005;const int INF = 0x3f3f3f3f;int dp[... 阅读全文
posted @ 2015-01-28 20:49 Love风吟 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 题目大意:盒子的序号为1~n,每次从序号A>B的盒子,且(A+B)%2=1,(A+B)%3=0,从A中取任意个物品放入B中,知道不能操作很容易能看出的是只能是(A+B)%6==3的时候成立也就是 i % 6 =0 与 i % 6 = 3i % 6 = 1 与 i % 6 = 2i % 6 = 4 与... 阅读全文
posted @ 2015-01-28 20:41 Love风吟 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 题目大意:可以从某一堆中取任意个数,也可把一堆分成两个不为0的堆,直到某一方无法操作为输因为是nim博弈,所以只要考虑一堆时候的sg值,把所有堆的sg值异或即可很显然这里 0 是一个终止态 sg[0]=0;sg[1]=1 ;2 的时候可分为 0 , 1 , (1,1) 3种情况,sg值分别为 0,1... 阅读全文
posted @ 2015-01-28 16:36 Love风吟 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 从n个石子中每次取p~q个,求先手能否获胜可以先列举一部分数据,然后观察可得总是在p+q中循环,所以只要用n对p+q取模就好了#include #include #include using namespace std;int p,q;int main(){ // freopen("a.in" ... 阅读全文
posted @ 2015-01-28 16:07 Love风吟 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 可以先列举一部分小数据,可以发现以fib[0]=2,fib[1]=3开始的斐波那契数列中的数字表示必胜态#include #include #include using namespace std;#define ll long longconst ll INF = 0x7fffffff;int k... 阅读全文
posted @ 2015-01-28 16:04 Love风吟 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 优先队列:顾名思义,首先它是一个队列,但是它强调了“优先”二字,所以,已经不能算是一般意义上的队列了,它的“优先”意指取队首元素时,有一定的选择性,即根据元素的属性选择某一项值最优的出队~百度百科上这样描述的: 优先级队列 是不同于先进先出队列的另一种队列。每次从队列中取出的是具有最高优先权的元素... 阅读全文
posted @ 2015-01-28 12:03 Love风吟 阅读(431) 评论(0) 推荐(0) 编辑
2015年1月27日
摘要: 1. CodeForces 222B Cosmic Tables数据量比较大,这里不能直接暴力,用行指针和列指针表示当前行列是原来的第几行第几列#include #include #include using namespace std;const int N = 1005;int n ,m ,... 阅读全文
posted @ 2015-01-27 17:02 Love风吟 阅读(220) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 38 下一页