上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 37 下一页
摘要: #include#include#includeusing namespace std;int mp[25][25],vis[25],ans[25],sum;void dfs(int now,int cnt){ //printf(" %d\n",ans[0]); int ... 阅读全文
posted @ 2015-05-02 15:56 xryz 阅读(108) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#includeusing namespace std;double y;double fcn(double x){ double t=8*x*x*x*x+7*x*x*x+2*x*x+3*x+6-y; ret... 阅读全文
posted @ 2015-05-02 08:15 xryz 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 刚开始按一般搜索写一直错,没有想明白怎么回事。搜了一下其他人的思路才明白,本题有杀死守卫的时间,所以bfs搜索出来路径最短的不一定是时间最短的,所以使用了优先队列让他自己在队列里面排序解决。还有自己刚开始还将路变成了墙,现在想来也是错的,主要都是要杀人。 或者考虑一直搜索,每次将结果... 阅读全文
posted @ 2015-05-02 01:16 xryz 阅读(105) 评论(0) 推荐(0) 编辑
摘要: typedef long long ll; //通过这里调整值的范围const int N=1024;int a[N];struct Tree{ int left,right; //区间的端点 ll sum; //视题目要求而定}tree[4*N+10];//... 阅读全文
posted @ 2015-05-01 08:34 xryz 阅读(97) 评论(0) 推荐(0) 编辑
摘要: /* ***********************************************Author :xryzEmail :523689985@qq.comCreated Time :4-30 21:25:25File Name ... 阅读全文
posted @ 2015-05-01 08:13 xryz 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 三维树状数组,思维转化很有意思,好像是什么容斥原理。 主要原因是纯暴力肯定会超时,所以要优化,将某一点的和与该点状态想关联,用这样的方法来求解问题。#include #include #include #include #include #include #include #incl... 阅读全文
posted @ 2015-04-29 22:05 xryz 阅读(91) 评论(0) 推荐(0) 编辑
摘要: #includeint main(){ int n,i,a[5024],j,sum,mixx; while(~scanf("%d",&n)) { for(i=1;ia[j]) sum++; mixx=sum; ... 阅读全文
posted @ 2015-04-29 12:46 xryz 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 写了好久才ac,之前一直是re。 主要是二维树状数组#include#include#includeusing namespace std;int c[2000][2000];int lowbit(int x){ return x&(-x);}int sum(int x,int... 阅读全文
posted @ 2015-04-28 21:38 xryz 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 树状数组+二分查找/* ***********************************************Author :xryzEmail :523689985@qq.comCreated Time :4-26 22:23:18File ... 阅读全文
posted @ 2015-04-27 12:22 xryz 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 原来以为是强联通,后来经同学提醒,转化一下思路,如果是符合条件的图,那肯定可以到达1这一点,大概就是dfs的一个变型。#include#include#include#include#includeusing namespace std;int mp[10024];int dfs(i... 阅读全文
posted @ 2015-04-26 16:04 xryz 阅读(122) 评论(0) 推荐(0) 编辑
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 37 下一页