码迷,mamicode.com
首页 >  
搜索关键字:std    ( 41627个结果
nefu 627 剪纸游戏
题目:给定一个n*m大的纸张,上面表明了每块上的字母,在其背后给定了对应位置的字母的value,在最后给出需要剪出来的剪纸的字母序列。 方法:暴力搜索。 代码: #include #include #include #include using namespace std; char map[502][502]; int Map[502][502]; int vis[502][502...
分类:其他好文   时间:2014-05-05 12:53:36    阅读次数:338
STL 之 空间适配器
1.sgi STL"标准"的空间适配器: 该适配器很简单,只是对new delete等内存分配释放函数的一层简单封装而已,所以sgi stl几乎没用上它(效率太低),代码位于defalloc.h.2.sgi stl特殊适配器 std::alloc: 该版本作为stl中的默认适配器,主要分成两个部分:...
分类:其他好文   时间:2014-05-04 12:41:42    阅读次数:381
POJ 1741 - Tree
LTC男人八题系列,测试数据之强真不是盖的。题目大意是在树上找出所有满足长度 2 #include 3 using namespace std; 4 5 6 #define FOR(p,i,s,t) for(__typeof(p) i=s; it, Vs[eptr].l = this...
分类:其他好文   时间:2014-05-03 22:47:34    阅读次数:419
hdu 1114 完全背包问题
题意:给定背包体积与物品的体积与价值 求正好放完的最小价值#includeusing namespace std;int min(int a,int b){ if(a>t; while(t--) { cin>>m1>>m2; m=m2-m1; ...
分类:其他好文   时间:2014-05-03 22:37:20    阅读次数:437
hdu 1087 最大上升子序列和
题意:求最大上升子序列和#includeusing namespace std;int main(){ int n,a[1001],b[1001],max; while(cin>>n&&n!=0) { for(int i=1;i>a[i]; b[1]=a...
分类:其他好文   时间:2014-05-03 22:29:38    阅读次数:282
unicode string和ansi string的转换函数及获取程序运行路径的代码
#pragma once#include namespace stds { class tool { public: std::string ws2s(const std::wstring& ws) { std::string curLocale = setlocale(LC_ALL...
分类:其他好文   时间:2014-05-03 22:25:17    阅读次数:318
UVA 1372 - Log Jumping(推理)
题目链接:1372 - Log Jumping 题意:给定一些n个木板的起始位置和长度k,相重叠的木板可以互相跳跃,求能构成环的最大数量。 思路:先按起始位置排序,然后每次多一个木板就去判断他和前一个和前前一个能不能互相跳跃,如果可以的话就可以多加上这个木板。 代码: #include #include #include using namespace std; #define ma...
分类:其他好文   时间:2014-05-03 21:44:03    阅读次数:247
boost::serialization(2)序列化基类
在派生类中序列化一个基类 假如有一个基类如下: class student_info { public: student_info() {} virtual ~student_info() {} student_info(const std::string& sn, const std::string& snm, const std::string& sg) : name_(sn),...
分类:其他好文   时间:2014-05-03 21:41:12    阅读次数:356
C++程序设计项目开发——银行自动提款机(三)
在输入密码时,实现有限次密码输入的限制,如果三次都没有输入正确,程序将直接退出,不允许用户继续操作。 #include #include using namespace std; int main() { string pwd; int cLogin=0; do { cout<>pwd; if (pwd!="123") { ...
分类:编程语言   时间:2014-05-03 17:45:26    阅读次数:354
nefu 650 max num
题目:经典dp题目,求出最大相邻子序列的和。 方法:给出两种方法,一种dp,一种直接暴力(数据量小的时候可以考虑)。 代码1: #include #include using namespace std; int main() { int n; int t=1; cin>>n; int s[100010]; while(t<=n) { ...
分类:其他好文   时间:2014-05-03 17:02:34    阅读次数:324
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!