码迷,mamicode.com
首页 >  
搜索关键字:namespace    ( 41927个结果
HDU 1507 Uncle Tom's Inherited Land*(二分匹配,输出任意一组解)
要输出任意一组解。一开始时两边都是n*m-k个点做的,答案输出一半,但是错掉了,匹配数没有问题,就是输出解会出错。后来按照奇偶分成两部分就可以了 #include #include #include #include #include using namespace std; const int MAXN=510; int uN,vN; int g[MAXN][MAXN]; int link...
分类:其他好文   时间:2015-06-17 18:17:49    阅读次数:112
数据结构与算法-----堆栈篇
堆栈1.基本特征:后进先出 2.基本操作:压入(push),弹出(pop) 3.实现要点:初始化空间、栈顶指针、判空判满 实践:使用C++语言实现堆栈类,进行示例演示并且根据此堆栈类实现进制的转换。“`include using namespace std; class Stack { public: // 构造函数中分配内存空间 Stack (size_t size...
分类:编程语言   时间:2015-06-17 18:16:56    阅读次数:168
poj 3259 wormholes AC代码(负权环判断, Bellmanford)
#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include using namespace std; const int INF = 10001; struct Edge { int from; int to; int w...
分类:其他好文   时间:2015-06-17 16:51:50    阅读次数:98
常用ADO.NET操作ACCESS数据库
using System;using System.Collections.Generic;using System.Text;using System.Data;//using System.Data.OleDb;//using System.Drawing;//namespace EColor{...
分类:数据库   时间:2015-06-17 16:36:43    阅读次数:141
【插入排序】直接,折半,二路,希尔
插入排序 给出一下四种方法: 直接插入排序,折半插入排序,二路插入排序,希尔插入排序 代码实现: #include using namespace std; #define size 21 typedef int Sqlist[size]; void SInsertSort(Sqlist &L, int n) //直接插入 { cout << "直接插...
分类:编程语言   时间:2015-06-17 15:30:06    阅读次数:140
C++ map 自定义比较函数
#include #include using namespace std;void fun(int a[]){ a[0] = 12;}struct compare{ bool operator()(const char * s1, const char * s2) const {...
分类:编程语言   时间:2015-06-17 13:07:22    阅读次数:717
opencv中ptr的使用
#include #include#include#includeusing namespace cv;void colorReduce(Mat &image,int div =64){ int nl = image.rows; int nc =image.cols*image.chan...
分类:其他好文   时间:2015-06-17 10:51:38    阅读次数:239
UVa 10622 - Perfect P-th Powers(数论)
#include #include #include #include #include #include using namespace std; int find(int n) { for (int i = 2 ; i < 50000 ; ++ i) { if (pow(0.0+i, (int)(log10(fabs(n+0.0))/log10(i+0.0)+0.01))...
分类:其他好文   时间:2015-06-17 09:45:25    阅读次数:103
HDU 2222 Keywords Search AC自动机模板
题目链接: hdu2222 代码: #include #include #include #include #include using namespace std; struct node { int sum; node* fail; node* next[26]; node() { s...
分类:其他好文   时间:2015-06-17 09:45:09    阅读次数:109
hdu 1281 棋盘游戏
将行和列的标号组成X和Y集合,然后如果x,y坐标可以放车,就在x和y点之间连一条线,不同行和列车就不会相互攻击,所以求出最大匹配就是所得的最多可放车额个数 然后枚举每个点,判断其是否为重要点 #include #include #include using namespace std; #define N 102 int map[N][N],visit[N],match[N]; int n,m,...
分类:其他好文   时间:2015-06-17 09:44:47    阅读次数:153
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!