码迷,mamicode.com
首页 >  
搜索关键字:namespace    ( 41927个结果
Codeforces Round #243 (Div. 2) B. Sereja and Mirroring
#include #include #include using namespace std;int main(){ int n,m; cin >> n >> m; vector > a(n,vector(m,0)); for(int i = 0; i > a[i][j]; ...
分类:其他好文   时间:2014-04-29 17:41:18    阅读次数:425
括号配对问题
括号配对问题时间限制:3000ms | 内存限制:65535KB难度:3描述现在,有一行括号序列,请你检查这行括号是否配对。输入第一行输入一个数N(0#include#include#include#include#include#includeusing namespace std;int mai...
分类:其他好文   时间:2014-04-29 17:32:03    阅读次数:420
C++虚复制构造函数
构造函数不能是虚函数。但有时候确实需要能传递一个指向基类对象的指针,并且有已创建的派生类对象的拷贝。通常在类内部创建一个Clone()方法,并设置为虚函数。//Listing 12.11 Virtual copy constructor#include using namespace std;cla...
分类:编程语言   时间:2014-04-29 17:26:52    阅读次数:522
Codeforces Round #243 (Div. 2) A. Sereja and Mugs
#include #include #include #include using namespace std;int main(){ int n,s; cin >> n >> s; vector a(n); for(int i = 0 ; i > a[i]; sort...
分类:其他好文   时间:2014-04-29 16:42:39    阅读次数:415
万年历制作
#include#includeusing namespace std;void printMonth(int year, int month);void printMonthTitle(int year, int month);void printMonthName(int month);void...
分类:其他好文   时间:2014-04-29 15:36:57    阅读次数:405
《Cracking the Coding Interview》——第17章:普通题——题目7
2014-04-28 23:28题目:给定一个数字,用英语把它读出来。解法:ZOJ上有相反的题目。如果我要用中文读书来呢?代码: 1 // 17.7 Read an integer in English. 2 #include 3 #include 4 using namespace s...
分类:其他好文   时间:2014-04-29 15:29:44    阅读次数:423
《Cracking the Coding Interview》——第18章:难题——题目1
2014-04-29 00:56题目:不用算数运算,完成加法。解法:那就位运算吧,用加法器的做法就可以了。代码: 1 // 18.1 add two numbers wihout using arithmetic operator. 2 #include 3 using namespace std....
分类:其他好文   时间:2014-04-29 14:58:53    阅读次数:383
《Cracking the Coding Interview》——第18章:难题——题目4
2014-04-29 01:05题目:数数从0到n总共有多少个数字‘2’?解法:数位动态规划,可以O(log10(n))时间内解决。代码: 1 // 18.4 Count the number of 2s from 0 to n. 2 #include 3 using namespace std;....
分类:其他好文   时间:2014-04-29 14:44:34    阅读次数:380
分数拆分
//现在输入一个正整数k,找到所有的正整数x>=y,使得1/k=1/x+1/y.#includeusing namespace std;int main(){ int n; //测试数据组数 cin>>n; int y; double x; while(n--) ...
分类:其他好文   时间:2014-04-29 09:38:47    阅读次数:360
Codeforces Round #243 (Div. 2) C. Sereja and Swaps
由于n比较小,直接暴力解决#include #include #include #include #include #includeusing namespace std;int main(){ int n,k; cin >> n >> k; vector a(n); for...
分类:其他好文   时间:2014-04-29 09:18:46    阅读次数:412
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!