自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(13)
  • 问答 (1)
  • 收藏
  • 关注

原创 哈尔滨理工大学软件学院 1450 经商 (易错并查集+01背包)

#include#include#includeusing namespace std;const int maxn=1e6+5;int fa[maxn];int u[maxn];int v[maxn];int n,m,c;int T[maxn];int dp[maxn];int rank1[10005];void init(){ for(int i=1; i<

2016-11-21 20:57:39 165

原创 哈尔滨理工大学软件学院OJ 1451 经商(大树/ 斐波那契数列)

#include#include#includeusing namespace std;struct node{ long long a[3][3];}T;const int MOD=1000000007;node muli(node x,node y){ node temp; for(int i=1;i<=2;i++) { fo

2016-11-21 20:53:31 1527

原创 HDU 4508 湫湫系列故事——减肥记I (完全背包)

#include#include#includeusing namespace std;const int maxn=105;struct node{ int a,b;}T[maxn];int dp[100005];int main(){ int n; while(~scanf("%d",&n)) { memset(dp,0,s

2016-11-15 21:42:22 393

原创 HDU 2546 饭卡 (01背包)

#include#include#includeusing namespace std;int a[1005];int dp[1005][1005];int main(){ int n; while(~scanf("%d",&n)) { if(n==0) return 0; memset(dp,0,sizeof(dp));

2016-11-15 21:12:55 297

原创 哈尔滨理工大学软件学院OJ 1419: 最大的XⅡ

#include#include#includeusing namespace std;int n,m;char maps[1005][1005];int main(){ while(~scanf("%d%d",&n,&m)) { for(int i=1; i<=n; i++) { scanf("%s",map

2016-11-14 17:41:57 1652

原创 HDU 1022 Train Problem I (stack)

#include#include#include#include#include#include#includeusing namespace std;char a[100005];char b[100005];stackQ1;stackQ2;int stra,strb;int judge(){ stra=strlen(a),strb=strlen(b);

2016-11-10 18:24:37 310

原创 HDU 2094 产生冠军 (不重复集合set)

#include#include#include#include#include#include#includeusing namespace std;int main(){ int t; while(~scanf("%d",&t)) { if(t==0) return 0; string a,b; s

2016-11-10 14:48:34 302

原创 PJ 2566 Bound Found (尺取法)

#include#include#includeusing namespace std;const int maxn=1e5+5;int n,k;pairE[maxn];int solve(int x)//尺取法并不是简单的暴力{ int l=0,r=1; int dis=1e9+5,ui,op; int ans; while(l<=n&&r<=

2016-11-08 21:53:32 305

原创 POJ 3320 Jessica's Reading Problem (尺取法)

#include#include#include#include#includeusing namespace std;int a[1000005];int main(){ int t; while(~scanf("%d",&t)) { setT; mapE; for(int i=1; i<=t; i++)

2016-11-07 16:53:57 262

原创 HDU 5154 Harry and Magical Computer (Floyd)

#include#include#includeusing namespace std;int maps[105][105];int n,m;int main(){ while(~scanf("%d%d",&n,&m)) { memset(maps,0,sizeof(maps)); int flag=0; for(in

2016-11-06 21:48:28 362

原创 HDU 5154 Harry and Magical Computer (强连通分量)

#include#include#include#include#includeusing namespace std;const int maxn=1005;vectorG[maxn];int pre[maxn],lowlink[maxn],sccno[maxn],dfs_clock,scc_cnt;stackS;int n,m;void dfs(int u)//大白的

2016-11-06 21:37:52 395

原创 HDU 5154 Harry and Magical Computer (拓扑排序)

#include#includeusing namespace std;int degree[505],res[505];bool maps[505][505];int n,m;void topo() //直接抄板子。{ int p; for(int i=1; i<=n; i++) { p=-1; for(int j

2016-11-06 15:40:53 372

原创 HDU 5154 Harry and Magical Computer (BFS)

#include#include#include#includeusing namespace std;int n,m;int maps[105][105];int book[105];int main(){ while(~scanf("%d%d",&n,&m)) { memset(maps,0,sizeof(maps)); me

2016-11-06 00:30:01 340

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除