码迷,mamicode.com
首页 >  
搜索关键字:std    ( 41627个结果
hdu 4460
break point 在 边数很少,o(n*m)暴力出奇迹~~~#include#include#include#include#include#include#includeusing namespace std;const int maxn = 1005, maxm = 22222, inf=...
分类:其他好文   时间:2014-06-09 23:00:47    阅读次数:342
zoj1409 Communication System
【题解】:【代码】: 1 #include 2 #include 3 #include 4 #define inf 99999999 5 using namespace std; 6 int dp[105][10005];//i件设备,最小带宽(瓶颈)为j时的最小花费 7 int B[105]...
分类:其他好文   时间:2014-06-09 22:35:23    阅读次数:259
nupt1207(重数问题)
1.统计重数及次数。2.hash。%p,若冲突,则向后移动。******************************#include#include#includeusing namespace std;const int maxn=5000000;const int p=1200007;str...
分类:其他好文   时间:2014-06-09 22:34:07    阅读次数:211
快速求幂运算笔记
如何快速求x得n次方呢? 首先C++里面有个pow如何实现呢?自己查查,里面使用double,肯定更麻烦,还有jianzhi 我们会顺手写下 int res=1; for(int i=1;iusing namespace std;int pow1(int x,int n){ int res=1; f...
分类:其他好文   时间:2014-06-09 22:28:52    阅读次数:373
对C++ Primer的10.3.9单词转换的思考
#include #include #include #include #include using namespace std;ifstream& open_file(ifstream&,const string&);int main(int argc, char **argv){ map ...
分类:编程语言   时间:2014-06-09 00:04:20    阅读次数:334
poj3335 半平面交模版
#include#include#include#includeusing namespace std;typedef double dd;#define N 200struct P{ dd x,y; P(dd a=0,dd b=0){ x=a,y=b; ...
分类:其他好文   时间:2014-06-09 00:00:13    阅读次数:230
zoj1425 Crossed Matchings
【题解】:【代码】: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int dp[105][105]; 7 int N1,N2; 8 int a[105],b[105]; 9 int main(){10 int...
分类:其他好文   时间:2014-06-08 23:09:50    阅读次数:270
【HDOJ】3789 奥运排序问题
写了个函数指针,这题目很水,但是佷烦。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 #define MAXN 305 8 9 typedef struct {10 int id, g...
分类:其他好文   时间:2014-06-08 20:55:48    阅读次数:202
HDU 3537
翻硬币游戏,纯。。注意要判重 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 int a[105],n; 8 9 int sg(int x){10 int tmp=x,cnt=0;11 ...
分类:其他好文   时间:2014-06-08 20:53:49    阅读次数:266
简单排序poj2388
#include #include #include #include using namespace std;int cmp(const void *a,const void *b){ return *(int *)a-*(int *)b;}int main(){ int n; ...
分类:其他好文   时间:2014-06-08 20:51:16    阅读次数:202
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!