- 博客(4)
- 收藏
- 关注
原创 文章标题
#include<cstdio> #include<cstring> #define MAX 100005 typedef struct Node { int x; int dis; }; Node que[200006]; Node st,f; int vis[2000006];//注意乘法越界问题 int k,n,flag; int has( int i )
2015-05-15 00:51:20
109
原创 Sum It Up
Description Given a specified total t and a list of n integers, find all distinct sums using numbers from the list that add up to t. For example, if t=4, n=6, and the list is [4,3,2,2,1,1], then there
2015-05-01 22:24:22
193
转载 并查集
#include int pre[1000 ]; int find(int a) { if(pre[a]==a) return a; else return pre[a]=find(pre[a]); } //int find(int x) { //int r=x; //while (pre[r ]!=r) //r=pre[r ];
2015-01-21 09:25:52
125
原创 dfs
#include #include #include using namespace std; int a[10]={5,9,-6,14,56,43,-23,9,4,8}; int ans[1000000]; int k=6; int x=93; int n=10; void dfs(int now,int snum,int s) { if(x==s&&snum==k)
2015-01-21 09:24:56
137
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人