码迷,mamicode.com
首页 >  
搜索关键字:namespace    ( 41927个结果
线程初级基础(一)
一,单线程例子#include #include #include #include using namespace std;void *thread_func(void *arg){ for(int i=0; i<3; i++) { sleep(1); co...
分类:编程语言   时间:2014-09-16 01:30:19    阅读次数:243
UVA 10779 Collectors Problem 网络流+建图
题目链接:点击打开链接 题意:白书P370 #include #include #include #include #include #include using namespace std; #define ll int const int MAXN = 100010;//点数的最大值 const int MAXM = 400010;//边数的最大值 #define N M...
分类:其他好文   时间:2014-09-16 00:27:09    阅读次数:241
POJ1503
1 #include 2 #include 3 #include 4 using namespace std; 5 6 int main() 7 { 8 int N = 400; 9 //input用来存储输入数据10 int input[N][N];11 ...
分类:其他好文   时间:2014-09-16 00:13:49    阅读次数:322
2014 网选 5007 Post Robot(暴力或者AC_自动机(有点小题大作了))
//暴力,从每一行的开始处开始寻找要查询的字符#include#include#include#includeusing namespace std;char str[100005];int main(){ while(gets(str)){ for(int i=0; str[i...
分类:其他好文   时间:2014-09-16 00:12:29    阅读次数:339
使用DataContractSerializer类实现深拷贝操作
1 实现深拷贝方法 using System.IO; using System.Runtime.Serialization; namespace DeepCopyExp { class DeepCopy { public static T DeepCopyByDCS(T obj) { T newO...
分类:其他好文   时间:2014-09-15 22:56:49    阅读次数:383
用栈实现队列的效果
用两个栈实现队列的效果,可以入栈,出栈,判空等。。。 实现的栈基本功能 lstack.h #ifndef _LSTACK_H #define _LSTACK_H #include using namespace std; // 基于链式表的堆栈 class Stack { public: // 构造过程中初始化为空堆栈 Stack (void) : m_top (NULL) {} /...
分类:其他好文   时间:2014-09-15 22:56:39    阅读次数:481
HDU 5006 Resistance(鞍山网络赛J题)
HDU 5006 Resistance 思路:这题由于数据是随机的。。电阻不是1就是0,就可以先缩点,把电阻为0的那些边缩掉,只考虑有电阻的边,这样的话缩下来点数就不多了,就可以利用高斯消元+基尔霍夫定律去搞了 代码: #include #include #include #include #include using namespace std; const int...
分类:其他好文   时间:2014-09-15 22:55:54    阅读次数:294
POJ 3749
第一道简单密码学的题,太水了,本不打算做,第一道,还是纪念一下。#include #include #include #include #include using namespace std;char trans[30]={'V','W','X','Y','Z','A','B','C','D','...
分类:其他好文   时间:2014-09-15 22:47:59    阅读次数:264
POJ 1379 Run Away 模拟退火
一开始写了一发很快的,发现一会能过一会不能,貌似有点悬,毕竟是随机算法。后来重写了一发迭代5遍的,基本上把把AC了= =模拟退火果然是一种不是很靠谱的算法。#include #include #include #include #include #include using namespace st...
分类:其他好文   时间:2014-09-15 22:46:09    阅读次数:241
HDU 5017 Ellipsoid 模拟退火
网赛的时候感觉可以用模拟退火搞但是不会写,今天学了一下感觉模拟退火本身也不是很难= =#include #include #include #include using namespace std;const double eps = 1e-8;const double r = 0.99; //降温...
分类:其他好文   时间:2014-09-15 22:33:59    阅读次数:271
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!