码迷,mamicode.com
首页 >  
搜索关键字:std    ( 41627个结果
POJ1836 Alignment 【LIS(二分)+枚举】
a1,a2,a3,a4,a5,a6...an 对ai求出a1到ai的lis,ai+1到an的lds 取所有ai对应的lis+lds最大值 输出n-lis-lds #include #include #include #include #include #include using namespace std; int n; double num[1111]; double up...
分类:其他好文   时间:2014-06-09 23:29:00    阅读次数:249
POJ 1021 人品题
报告见代码。。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 const int MAX=105; 8 int dir[4][2]={1,0,-1,0,0,1,0,-1}; 9...
分类:其他好文   时间:2014-06-09 23:04:01    阅读次数:261
转换MFC CString 到std::string
std::string CStringToSTDStr(const CString& theCStr) { // Convert the CString to a regular char array const int theCStrLen = theCStr.GetLength(); char *buffer = (char*)malloc(sizeof(char)*(theCStrLe...
分类:其他好文   时间:2014-06-08 16:33:53    阅读次数:218
HDU 1754 I hate it 分段树Segment Tree题解
给出一段数据,然后要更新单个数据,会询问一段数据中的最大值。 又是一道分段树操作。渐渐熟手了。 #pragma once #include #include using namespace std; class IHateIt_1754_1 { static const int SIZE = 200001; int *segTree; //不要使用segTree[SIZE<<2]...
分类:其他好文   时间:2014-06-08 15:40:21    阅读次数:208
刨根问底:C++中浮点型变量(float, double)的比较问题。
首先,让我们先来看一段代码: #include #include int main() { using namespace std; cout<<setprecision(17); float num1 = 1.1; double num2 = 1.1; if (num1 == num2) cout << "yes"<<endl; else cout <<...
分类:编程语言   时间:2014-06-08 15:07:36    阅读次数:250
poj 3268 Silver Cow Party , spfa , dijkstra
点击打开链接 两次求最短路(第二次把边反向求) 1、spfa //poj 3268 Silver Cow Party //SPFA #include #include #include using namespace std; const int M = 100000 + 100; const int N = 1000 + 100; const int inf = 1...
分类:其他好文   时间:2014-06-08 05:29:39    阅读次数:241
Light OJ 1026 Critical Links 求桥
题目来源:Light OJ 1026 Critical Links 题意:输出桥 思路:模版 #include #include #include #include #include using namespace std; const int maxn = 10010; struct Edge { int u, v; Edge(){} Edge(int u, int v):...
分类:其他好文   时间:2014-06-08 04:07:05    阅读次数:235
C++学习笔记-list遍历
// ConsoleApplication1.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include #include #include #include #include #include #include using namespace std; int _tmain(int argc, _TCHAR* argv[]) { i...
分类:编程语言   时间:2014-06-08 03:24:24    阅读次数:357
Light OJ 1291 Real Life Traffic 双连通最少添边数
题目来源:Light OJ 1291 Real Life Traffic 题意:最少添加几条边 可以使全图边双连通 思路:缩点 重新构图 答案就是(叶子节点数+1)/ 2 #include #include #include #include #include using namespace std; const int maxn = 10010; struct Edge { i...
分类:其他好文   时间:2014-06-08 02:57:26    阅读次数:276
多项式的表示
1.多项式的系数存放在数组中 # include # include # define max(x,y) ((x)>(y)?(x):(y)) using namespace std; const int N=100; struct poly { int arr[N]; int mexp; }; void add(poly &a,poly &b,poly &c) { memset(c.ar...
分类:其他好文   时间:2014-06-08 02:17:57    阅读次数:264
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!