会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
Drinkwater_cnyali
博客园
首页
新随笔
联系
管理
订阅
上一页
1
···
3
4
5
6
7
8
下一页
2016年9月10日
进制转换
摘要: #include#include#include#includeusing namespace std;string transform(int x,int y,string s){//进制转换 string res="";//存储 int sum=0; for(int i=0;i='0'&&s...
阅读全文
posted @ 2016-09-10 17:18 Drinkwater_cnyali
阅读(110)
评论(0)
推荐(0)
编辑
2016年9月6日
二分查找
摘要: #include #include int a[1000000+10]; int main(){ int i,j,k,m,n,max=0; scanf("%d%d",&n,&k); for(i=1;ik) r=m-1; ...
阅读全文
posted @ 2016-09-06 20:44 Drinkwater_cnyali
阅读(99)
评论(0)
推荐(0)
编辑
2016年9月5日
进制转换
摘要: 显然,学完位运算之后,进制转换其实很容易的。。。2的二进制为10,逢二进一,就是2^2-1,其实很容易的。。。#include#includeusing namespace std;const int maxn = 510;int a[maxn],s[maxn];int main(){ int i,...
阅读全文
posted @ 2016-09-05 20:34 Drinkwater_cnyali
阅读(110)
评论(0)
推荐(0)
编辑
2016年9月3日
prim有意思。。。
摘要: #include#include#define inf 99999999using namespace std;const int maxn=1010;int a[maxn][maxn],dis[maxn],p[maxn];int maxin(){ int i,j,k,m,n,sum=0,ans=...
阅读全文
posted @ 2016-09-03 11:09 Drinkwater_cnyali
阅读(101)
评论(0)
推荐(0)
编辑
2016年9月2日
嗯,kruscal多的就不讲了
摘要: #include#include#includeusing namespace std;const int maxn=10000;#define inf 999999999;int p[maxn][maxn],e[maxn][maxn],dis[maxn],f[maxn];struct T{ in...
阅读全文
posted @ 2016-09-02 19:43 Drinkwater_cnyali
阅读(106)
评论(0)
推荐(0)
编辑
2016年8月30日
采药(洛谷简单dp背包问题)
摘要: #include#include#include#includeusing namespace std;const int maxn= 1000+10;int dp[maxn],t[maxn],c[maxn];int main(){ int i,j,k,m,n; scanf("%d%d",&n,&m...
阅读全文
posted @ 2016-08-30 20:51 Drinkwater_cnyali
阅读(225)
评论(0)
推荐(0)
编辑
2016年8月27日
最小生成树
摘要: 最近学了一下最小生成树。。。发发code#include#include#include#includeusing namespace std;const int maxn=1000;struct edge{//定一个结构体来存起点,终点和边权,便于后面的将边权排序; int u,v,w;}a[m...
阅读全文
posted @ 2016-08-27 19:36 Drinkwater_cnyali
阅读(88)
评论(0)
推荐(0)
编辑
bfs解救小哈
摘要: #include#include#include#includeusing namespace std;int mi=99999999999;int xb,yb,xe,ye;const int maxn=51;int a[maxn][maxn],book[maxn][maxn];int move[4...
阅读全文
posted @ 2016-08-27 16:37 Drinkwater_cnyali
阅读(190)
评论(0)
推荐(0)
编辑
划分树
摘要: 转自大神的详解: http://www.2cto.com/kf/201210/160552.html用划分树来解决选定区间内的第K大值,其实也就两步!一步是建树,另一步则是查询。 先说我对建树的理解吧! 建树的过程很简单:两步就OK了! 第一步:找到序列的中位数,把大于中位数的扔到...
阅读全文
posted @ 2016-08-27 15:35 Drinkwater_cnyali
阅读(142)
评论(0)
推荐(0)
编辑
各种排序方法
摘要: //堆排序#include#includeint a[100010],len=0;void insert(int x){ a[++len]=x; int k=len,t; while(k>1 && a[k]a[2*k] && 2*ka[2*k+1] && 2*k+1a[m+1] && m+1#inc...
阅读全文
posted @ 2016-08-27 15:22 Drinkwater_cnyali
阅读(150)
评论(0)
推荐(0)
编辑
上一页
1
···
3
4
5
6
7
8
下一页
公告