会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
wspl98765
博客园
|
首页
|
新随笔
|
新文章
|
联系
|
订阅
|
管理
上一页
1
2
3
4
5
6
下一页
2017年2月26日
食物链
摘要: 100 71 101 12 1 22 2 32 3 31 1 32 3 11 5 5#includeusing namespace std;int f[200000];int ans;int n;int k;int find(int x){ if(f[x]==x) retur...
阅读全文
posted @ 2017-02-26 10:51 wspl98765
阅读(136)
评论(0)
推荐(0)
编辑
2017年2月24日
银河英雄传说
摘要: #include#include#include#includeusing namespace std;int t;int q[99999];int h[99999];int f[99999];int find(int x){ if(f[x]==x)return x; ...
阅读全文
posted @ 2017-02-24 14:35 wspl98765
阅读(134)
评论(0)
推荐(0)
编辑
2017年2月19日
团伙
摘要: 反集的反集不是朋友。。。要是把他们合并便多了//并查集+反集的思想 #include#includeusing namespace std;int n,m;int flag;int flag1[9999];int f[2500];int find(int x){ if(f[x...
阅读全文
posted @ 2017-02-19 09:00 wspl98765
阅读(128)
评论(0)
推荐(0)
编辑
2017年2月9日
奖金(拓补排序的应用)
摘要: 谁应该高谁的入度++,并记录下谁比低的高(低的得出度),所以入度为零的就是最低的(好不公平),找出所有最低的,将他们算作一层,奖金++(算是拓补排序吧)#include#include #includeusing namespace std;int n;int r[9999];in...
阅读全文
posted @ 2017-02-09 15:58 wspl98765
阅读(156)
评论(0)
推荐(0)
编辑
拓补排序之烦人的幻灯片(确实很烦人。。。)
摘要: 将入度为一的区间(也就是唯一匹配的点和区间)找出来,把这个点所有出度的入度–,给这个点做标记,输出 继续执行以上操作#include#include #includeusing namespace std;struct hu{ int x,y; int z,w;}a[9...
阅读全文
posted @ 2017-02-09 15:53 wspl98765
阅读(150)
评论(0)
推荐(0)
编辑
2017年2月8日
乌龟棋
摘要: 朴素搜索 30分 tle#include#includeusing namespace std;int n,m;int q;int dp[99999];int a[999999];int f[1999];int max1=-9999999;void dfs(int x,int a...
阅读全文
posted @ 2017-02-08 16:44 wspl98765
阅读(151)
评论(0)
推荐(0)
编辑
能量项链
摘要: #include#includeusing namespace std;int n;int f[1999][1999];int a[9999];int ans;int max1=-999999999;int main(){ scanf("%d",&n); for(int...
阅读全文
posted @ 2017-02-08 16:29 wspl98765
阅读(91)
评论(0)
推荐(0)
编辑
金明的预算方案(组合背包)
摘要: 组合背包#includeusing namespace std;int v[9999];int w[9999];int k[9999];int f[99999];int n,m;int t=0;int s[9999][10];int main(){ scanf("%d%d",...
阅读全文
posted @ 2017-02-08 11:36 wspl98765
阅读(116)
评论(0)
推荐(0)
编辑
2017年2月7日
N皇后 (位运算)
摘要: 二进制log2(t)+1 便是位数#include#include#include #include#include#include using namespace std;int n;int p;int s=0; int sol[999];int ans=0;int log2(i...
阅读全文
posted @ 2017-02-07 15:09 wspl98765
阅读(216)
评论(0)
推荐(0)
编辑
2017年2月6日
抓住那头牛
摘要: 广度优先搜索,深搜超时 需要判断界限,做标记,已到过的地点就不必去了#include#includeusing namespace std;int head=0,tail=1;int n,k;int f[199999];int d[9999999];int t[9999999];i...
阅读全文
posted @ 2017-02-06 14:14 wspl98765
阅读(164)
评论(0)
推荐(0)
编辑
上一页
1
2
3
4
5
6
下一页
公告