码迷,mamicode.com
首页 >  
搜索关键字:xunsearch namespace    ( 41960个结果
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
Codeforces Round #244 (Div. 2) B. Prison Transfer
题目是选出c个连续的囚犯,而且囚犯的级别不能大于t#include using namespace std;int main(){ int n,t,c; cin >> n >> t >> c; int a,cnt = 0, res =0;; for(int i = 0 ; i...
分类:其他好文   时间:2014-05-04 12:14:55    阅读次数:340
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
经典白话算法之快速排序
【分析】 【伪代码】 【运行过程】 【代码】 /********************************* * 日期:2014-04-01 * 作者:SJF0115 * 题目:快速排序 **********************************/ #include #include using namespace...
分类:其他好文   时间:2014-05-03 21:17:50    阅读次数:476
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
迷上了代码!