码迷,mamicode.com
首页 >  
搜索关键字:namespace 命名空间    ( 47219个结果
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
Codeforces Round #244 (Div. 2) A. Police Recruits
题目的意思就是找出未能及时处理的犯罪数,#include using namespace std;int main(){ int n; cin >> n; int a,recruit = 0, crimes = 0;; for(int i = 0 ; i > a; ...
分类:其他好文   时间:2014-05-04 11:54:32    阅读次数:274
概率法计算PI
#include using namespace std;//概率计算PIint main(){ int inside=0; double val; int i; for ( i=0; i<100000000; i++) { double x = (dou...
分类:其他好文   时间:2014-05-04 11:47:49    阅读次数:262
UVA 10405 Longest Common Subsequence
最长公共子系列,简单的dp,不过注意有空格,所以,在读字符串的时候,尽量用gets读,这样基本没问题#include#include#include#includeusing namespace std;int dp[1001][1001];int MAX(int x,int y){ if (...
分类:其他好文   时间:2014-05-04 11:34:41    阅读次数:294
20140503
1、队列(建议采用带头结点的链式队列) 何时为空?答:当队列头指针等于尾指针时,队列为空。(对一般队列而言,循环队列除外) //不带头结点的链式队列 //不带头结点的链式队列#include #include #include using namespace std; (出队操作) node1-->...
分类:其他好文   时间:2014-05-04 11:31:15    阅读次数:335
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
[连载]JavaScript讲义(04)--- 函数和闭包
讲解了JavaScript的函数、匿名函数、函数表达式、函数的递归调用、闭包等知识点,讲解了如何使用闭包来避免命名空间污染的问题,探讨了两个专题单例和回调...
分类:编程语言   时间:2014-05-03 21:50:51    阅读次数:297
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!