摘要: 这次写的凸包用的是Graham scan算法就数据结构上只是简单地运用了一个栈#include#include#include//#define LOCALusing namespace std;const int max1=1000;typedef struct point{ int x; int y;}point;int cp(point a,point b,point c){ c.x-=a.x; c.y-=a.y; b.x-=a.x; b.y-=a.y; return (b.x*c.y-b.y*c.x)>0;}int cmp(point a,point b){ if(a.y!=b. 阅读全文
posted @ 2013-12-21 17:27 ACalvin 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 对于SG函数来说,sg[y]=x的意义为,x与y的输赢状态是相同的sg[y]=mex(y)的定义与n.p点的定义是相同的#include#includeusing namespace std;int SG[1001],f[20]={1,2};int flag[20];void getfibo(){ int i; for(i=2;i>m>>n>>p) { if(m==0&&n==0&&p==0) break; ans=SG[m]^SG[n]^SG[p]; if(ans==0) cout<<"Nacci" 阅读全文
posted @ 2013-12-21 12:33 ACalvin 阅读(168) 评论(0) 推荐(0) 编辑