摘要: 题目链接随机算法使劲水...srand((unsigned)time(0))比srand(NULL)靠谱很多,可能是更加随机。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 #define LL __int64 9 int a[501][501],b[501][501],c[501][501];10 int main()11 {12 int i,j,k,flag,n;13 srand((unsigned)time(0));14 ... 阅读全文
posted @ 2013-07-24 21:30 Naix_x 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 题目链接虽然我不懂... 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 #define LL __int64 7 LL p[1001],o[1001]; 8 LL x,y; 9 LL ext_eulid(LL a,LL b)10 {11 LL t,d;12 if(b == 0)13 {14 x = 1;15 y = 0;16 return a;17 }18 d = ext_eulid(b,a%b);19 ... 阅读全文
posted @ 2013-07-24 13:39 Naix_x 阅读(178) 评论(2) 推荐(0) 编辑
摘要: 题目链接本来就对N*log(N)算法不大会....然后各种跪了,求出最长不下降+最长不上升-最少相同元素。求相同元素,用二分求上界搞的。代码里4个二分.... 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 int d[200001]; 8 int dd[200001]; 9 int f[200001]; 10 int a[200001]; 11 int same[200001]; 12 int n; 13 int bin1(int size,int x)... 阅读全文
posted @ 2013-07-24 11:19 Naix_x 阅读(356) 评论(0) 推荐(0) 编辑