随笔分类 -  stl+杂碎知识+概率算法

1
摘要:当你无论如何都无法获得某个文件的权限的时候可以按照下面的方法试试 转载地址:http://zhidao.baidu.com/link?url=kCCvpZPtj0cDtY-72-uWFR166iaNRebA4DYWMZh6VpQxTuf8QmwPSNqEke2Zq3T1nPUQDPkSCefaG2Z 阅读全文
posted @ 2016-07-24 18:33 HYDhyd 阅读(282) 评论(0) 推荐(0)
摘要:原文地址:http://yacare.iteye.com/blog/2010049 很多伙伴在更新VS2010,或者卸载VS2012安装2010后,建立Win32 Console Project/MFC项目时会出现"LINK : fatal error LNK1123: 转换到 COFF 期间失败: 阅读全文
posted @ 2016-06-26 17:46 HYDhyd 阅读(184) 评论(0) 推荐(0)
摘要:#include#include#include#define N 110000int a[N];int answer(int k) {int sum=0;while(k) { sum+=k%2; k/=2;}return sum;}int Min(int aa,int bb) {ret... 阅读全文
posted @ 2014-11-05 13:42 HYDhyd 阅读(156) 评论(0) 推荐(0)
摘要:/*坑啊数学函数的运用log处理,exp还原tle好长时间,一直用g++交,最后把别人正确的代码交上也是tle,用c++交一遍ac题意:有两个数量为n的糖果,一个人开始吃,吃到最后有一堆剩余为0的时候不吃,把另一堆留给另外一个另一个人,求另一个人得到糖果的期望,这个人吃第一堆糖果的概率是p,第二堆糖... 阅读全文
posted @ 2014-11-04 12:33 HYDhyd 阅读(243) 评论(0) 推荐(0)
摘要:转自:http://hi.baidu.com/czyuan_acm/blog/item/d0bf7a439d90d21b72f05d69.html1.如果要将一个大数以2进制形式读入 可以使用cin.nextBigInteger(2);当然也可以使用其他进制方式读入;2.如果要将一个大数转换成其他进... 阅读全文
posted @ 2014-10-21 12:04 HYDhyd 阅读(144) 评论(0) 推荐(0)
摘要:#include"string.h"#include"stdio.h"#include"iostream"#include"queue"#include"stack"#define M 10009#define N 100009#include"stdlib.h"#include"math.h"#d... 阅读全文
posted @ 2014-10-12 21:33 HYDhyd 阅读(595) 评论(0) 推荐(0)
摘要:iter=data.erase(iter);删掉转载:http://www.cnblogs.com/cobbliu/archive/2012/05/21/2512249.htmlSTL中的每个算法都非常精妙,接下来的几天我想集中学习一下STL中的算法。 ForwardIter lower_boun... 阅读全文
posted @ 2014-10-03 19:21 HYDhyd 阅读(283) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/niushuai666/article/details/6734403函数lower_bound()在first和last中的前闭后开区间进行二分查找,返回大于或等于val的第一个元素位置。如果所有元素都小于val,则返回last的位置举例如下:一个数组nu... 阅读全文
posted @ 2014-10-03 19:16 HYDhyd 阅读(633) 评论(0) 推荐(0)
摘要:转载:http://happyboy200032.blog.163.com/blog/static/46903113201291252033712/头文件:#includestd::bitset是STL的一部分,准确地说,std::bitset是一个模板类,它的模板参数不是类型,而整形的数值(这一特... 阅读全文
posted @ 2014-09-23 16:02 HYDhyd 阅读(334) 评论(0) 推荐(0)
摘要:/*题意:给n个电脑,求一个点到这n个电脑的距离和最小。模拟退火法:和poj1379的方法类似因为坐标范围是0-10000不妨把它看成是10000*10000的正方形来做*/#include#include#include#include#define inf 10000000000000using... 阅读全文
posted @ 2014-09-23 10:44 HYDhyd 阅读(156) 评论(0) 推荐(0)
摘要:/*模拟退火法: 找到一些随机点,从这些点出发,随机的方向坐标向外搜索; 最后找到这些随机点的最大值; 坑://if(xx>-eps&&xx-eps&&yy#include#include#include#define pi acos(-1.0)#define N 1100#define i... 阅读全文
posted @ 2014-09-22 17:41 HYDhyd 阅读(166) 评论(0) 推荐(0)
摘要:hdu 5017 http://blog.csdn.net/mypsq/article/details/39340601#include #include #include #include using namespace std;const int D[8][2] = {{0, 1}, {0,... 阅读全文
posted @ 2014-09-17 20:42 HYDhyd 阅读(128) 评论(0) 推荐(0)
摘要:转载:http://www.cnblogs.com/heaad/archive/2010/12/20/1911614.html优化算法入门系列文章目录(更新中): 1.模拟退火算法 2.遗传算法一. 爬山算法 ( Hill Climbing ) 介绍模拟退火前,先介绍爬山算法。爬山算法是一种简单... 阅读全文
posted @ 2014-09-17 20:27 HYDhyd 阅读(271) 评论(0) 推荐(0)
摘要:#include#include#include#includeusing namespace std;typedef struct node{ int x,y; bool operatorma; mapf,ff; node e; int n,m,i,j,k,t,id,idd... 阅读全文
posted @ 2014-08-12 17:29 HYDhyd 阅读(306) 评论(0) 推荐(0)
摘要:#pragma comment(linker, "/STACK:1024000000,1024000000") 阅读全文
posted @ 2014-08-10 15:16 HYDhyd 阅读(545) 评论(0) 推荐(0)
摘要:ACM中java的使用这里指的java速成,只限于java语法,包括输入输出,运算处理,字符串和高精度的处理,进制之间的转换等,能解决OJ上的一些高精度题目。1. 输入:格式为:Scanner cin = new Scanner (new BufferedInputStream(System.in)... 阅读全文
posted @ 2014-04-15 11:23 HYDhyd 阅读(282) 评论(0) 推荐(0)
摘要:char*strncpy(char*dest,char*src, size_tnum );功能:(c/c++)复制src中的内容(字符,数字、汉字....)到dest,复制多少由num的值决定,返回指向dest的指针。如果遇到null字符('\0'),且还没有到num个字符时,就用(num - n)... 阅读全文
posted @ 2014-03-31 09:51 HYDhyd 阅读(257) 评论(0) 推荐(0)
摘要:#include#include#include#include#include#include#define N 1100#includeusing namespace std;int pre[N],indegree[N];int find(int x) {if(pre[x]!=x)pre[x]=... 阅读全文
posted @ 2013-12-03 21:14 HYDhyd 阅读(140) 评论(0) 推荐(0)
摘要:#include#includeusing namespace std;int a[1100];int main() {int n,m,i;while(scanf("%d%d",&n,&m)!=EOF) {for(i=1;i<=n;i++)a[i]=i;for(i=1;i<m;i++)next_pe... 阅读全文
posted @ 2013-11-21 11:47 HYDhyd 阅读(110) 评论(0) 推荐(0)
摘要:#include#include#include#include#include#includeusing namespace std;mapmymap;int main() {int i,j,k,n,m;char s[4000],str[30],str2[30];string str1; sc... 阅读全文
posted @ 2013-11-14 10:29 HYDhyd 阅读(149) 评论(0) 推荐(0)

1