码迷,mamicode.com
首页 >  
搜索关键字:std    ( 41627个结果
20140710 loop-I
考试的时候写的dfs找自环然后求平均值当时感觉复杂度不是太高结果Wa和T了一些后只有40分。。。正解是二分答案再将所有边减去答案后用SPFA找有无负环即可 1 #include 2 #include 3 #include 4 using namespace std; 5 #define N 6...
分类:其他好文   时间:2014-07-13 00:47:36    阅读次数:293
Composite Design Pattern 组合设计模式
组合设计模式,就是可以把多个类组合在一个大类中,形成一个树形结构。 #include #include #include using namespace std; class Coporate { protected: string name; set coporate; public: explicit Coporate(string n = "", string d...
分类:其他好文   时间:2014-07-12 19:12:55    阅读次数:156
Pet
点击打开链接 bfs,需要自己构图 #include #include #include #include #include using namespace std; const int maxn = 100005; int dep[ maxn ]; int vis[ maxn ]; int pre[ maxn ]; vectormapp[ maxn ]; void Bfs( int...
分类:其他好文   时间:2014-07-12 17:20:26    阅读次数:139
20140711总结
第一题,傻逼题。但是忘判平方了。 1 #include 2 #include 3 #include 4 using namespace std; 5 int xx[4000001]; 6 inline void work(int n) 7 { 8 for(int i=1;i*i 2 #i...
分类:其他好文   时间:2014-07-12 16:20:40    阅读次数:202
hdu4570
1 #include 2 #define N 65 3 using namespace std; 4 5 const long long INF = 1LL>_;12 while(_--)13 {14 int n,i,j,k;15 cin>>n;...
分类:其他好文   时间:2014-07-12 15:03:45    阅读次数:198
hdu 2853 Assignment 费用流
就是本来就给出了一个匹配,然后让你求一个权值最大的匹配,并且和初始匹配变动最小。#include #include #include using namespace std;const int N=400;const int MAXE=20000000;const int inf=10&&d[u]+...
分类:其他好文   时间:2014-07-12 14:47:39    阅读次数:212
poj 3522 Slim Span 最大边减最小边最小的生成树
枚举最小边进行kruskal。#include #include using namespace std;#define maxn 120#define maxm 10000struct edge{ int u,v,w;}e[maxm];int p[maxn],n,m;int find(int...
分类:其他好文   时间:2014-07-12 14:37:52    阅读次数:250
HDU 2448 Mining Station on the Sea km
#include#include#include#include#includeusing namespace std;const int maxn = 105;const int INF = (1t){ slack[y]=t; } } ...
分类:其他好文   时间:2014-07-12 14:37:16    阅读次数:243
hdu 3315 My Brute 费用流,费用最小且代价最小
很常见的想法了= =#include #include #include using namespace std;const int N=400;const int MAXE=200000;const int inf=10&&d[u]+edge[j].w=0) printf("Oh, I lose ...
分类:其他好文   时间:2014-07-12 14:33:52    阅读次数:167
hdu 2487 Ugly Windows 模拟
#include #include #include #include using namespace std;char map[110][110];int n,m;#define inf 100000struct node{ int x,y;};vector nn;int main(){ ...
分类:Windows程序   时间:2014-07-12 14:31:49    阅读次数:260
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!