码迷,mamicode.com
首页 >  
搜索关键字:namespace    ( 41927个结果
POJ-3253 Fence Repair
AC代码如下: #include #include #include #include using namespace std; const int maxn=201314; int main() { int n,a[maxn]; while(cin>>n) { for(int i=0;i>a[i]; ...
分类:其他好文   时间:2015-02-09 20:21:01    阅读次数:102
Codeforces Fox And Dinner(最大流)
抄了个DINIC的模板,然后模拟一下。#include using namespace std;const int maxn=80005;const int inf=0x3f3f3f3f;typedef vector vi;typedef vector vii;bool vis[maxn];vect...
分类:其他好文   时间:2015-02-09 20:16:21    阅读次数:127
C++程序设计实践指导1.12数组中数据线性变换改写要求实现
改写要求1:分别用指针pa、pb代替数组改写要求2:从键盘输入data元素 元素个数任意,输入0结束#include #include using namespace std;class DATA{ double *pa,*pb; double max,min; dou...
分类:编程语言   时间:2015-02-09 20:01:26    阅读次数:155
线程安全的List集合(性能比较差..)
由于MS没有提供List的线程安全集合.自己动手写了一个,不过性能…不高..对于性能要求不高的情况下可以使用.using System; using System.Collections.Generic; using System.Linq; using System.Text;namespace System.Collections.Concurrent { /// ...
分类:编程语言   时间:2015-02-09 18:28:50    阅读次数:986
poj2431(优先队列)
注意题目给的是到终点的距离,需要转成到起点的距离,还有就是将终点也看成是加油站,这样写起来方便很多,不必要单独考虑最后一个加油站不在终点以后的情况 #include #include #include #include #include using namespace std; int N,P,L; pair d[10100]; bool cmp(pair a, pair b) {...
分类:其他好文   时间:2015-02-09 18:23:46    阅读次数:146
poj3253(优先队列)
#include #include #include #include #include using namespace std; int N,R; int x[50100]; int main() { #ifdef xxz freopen("in.txt","r",stdin); #endif // xxz ios::sync_with_stdio(false); ...
分类:其他好文   时间:2015-02-09 18:23:16    阅读次数:182
poj3617(字典序最小问题)
#include #include #include using namespace std; int n,m; char S[2100],P[2100]; int main() { #ifdef xxz freopen("in.txt","r",stdin); #endif // xxz ios::sync_with_stdio(false); cin.tie(0...
分类:其他好文   时间:2015-02-09 18:20:33    阅读次数:138
【HDOJ】3442 Three Kingdoms
bfs+状态压缩。初始化数组的曼哈顿距离条件写错了,改了一下午。 1 /* 3442 */ 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 9 #define...
分类:其他好文   时间:2015-02-09 17:51:06    阅读次数:110
POJ 3026 Borg Maze(bfs + prime)
解题思路: 先用BFS预处理出每个字母节点到其它节点的最短路径,然后套用prime算法。 #include #include #include #include #include #include #include #include #include #include #define LL long long using namespace std; const int ...
分类:其他好文   时间:2015-02-09 16:06:27    阅读次数:181
c++ string总结
?? 要想使用标准C++中string类,必须要包含 #include // 注意是,不是,带.h的是C语言中的头文件 using  std::string; using  std::wstring; 或 using namespace std; 下面你就可以使用string/wstring了,它们两分别对应着char和wchar_t。 string和wstring的用法是一样的,...
分类:编程语言   时间:2015-02-09 15:58:54    阅读次数:160
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!