- 博客(18)
- 收藏
- 关注
原创 1010 Radix (25)(25 分)(完成度:24/25)
目录题目:分析:反思:代码:题目:Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is "yes", if 6 is a decimal number and 110 is a binary number.N...
2018-07-25 17:45:59 836 2
原创 1012 The Best Rank (25)(25 分)
目录题目:反思:代码:题目:To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (Calculus or Lin...
2018-07-29 15:38:04 202
原创 1011 World Cup Betting (20)(20 分)
题目: With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup trophy in South ...
2018-07-28 18:40:24 499
转载 <functional>
转自:https://blog.csdn.net/fengbingchun/article/details/78006735侵删<functional>是C++标准库中的一个头文件,定义了C++标准中多个用于表示函数对象(function object)的类模板,包括算法操作、比较操作、逻辑操作;以及用于绑定函数对象的实参值的绑定器(binder)。这些类模板的实例是具有函数调...
2018-07-23 10:57:50 1379
转载 溢出
http://www.kuqin.com/shuoit/20140421/339376.html2. C/C++库文件的数据类型边界在C语言中的各数据类型的边界如下: 包含在头文件#include <limits.h> c++包含在#include <limits> – 引用的是limits.h的内容//limits.h#define MB_LEN_MA...
2018-07-23 10:31:19 325
原创 1009 Product of Polynomials (25)(25 分)
目录题目:反思:代码:题目:This time, you are supposed to find A*B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each ...
2018-07-21 19:14:25 285
原创 1003 Emergency (25)(25 分)
目录题目:代码:题目:As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in...
2018-07-21 14:48:04 448
原创 1002 A+B for Polynomials (25)(25 分)
目录题目:代码:题目:This time, you are supposed to find A+B where A and B are two polynomials.InputEach input file contains one test case. Each case occupies 2 lines, and each line contains the in...
2018-07-21 14:46:11 463
原创 1001 A+B Format (20)(20 分)
目录题目: 代码:题目:Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits).InputEac...
2018-07-21 14:44:17 344
原创 <vector>
vector的=是深拷贝,可以用a的值覆盖b的值,而不是单纯的指针指向变化。即vector<int> a(3),b(3);a[0]=0,b[0]=9;a[1]=1,b[1]=8;a[2]=2,b[2]=7;b=a;cout<<b[0]<<b[1]<<b[2];此时输出结果将是012...
2018-07-21 14:39:40 213
原创 1008 Elevator (20)(20 分)
目录题目: 代码:题目: The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified...
2018-07-20 20:33:40 309
原创 最大连续子序列和
目录问题描述:1、穷举法,复杂度O(n^3)2、穷举法改进,复杂度O(n^2)3、分治法,复杂度O(nlgn)4、联机算法,复杂度O(n)问题描述:输入一个数值数组,确定具有最大和的连续子序列vector<int> a;用来存储整个序列maxSum记录最大连续子序列的和left,right记录该序列的左右元素的下标;1、穷举法,复杂度O(n^...
2018-07-19 15:03:46 386
原创 1007 Maximum Subsequence Sum (25)(25 分)
目录题目:分析: 反思:代码:题目:Given a sequence of K integers { N~1~, N~2~, ..., N~K~ }. A continuous subsequence is defined to be { N~i~, N~i+1~, ..., N~j~ } where 1 <= i <= j <= K. TheMaxim...
2018-07-19 09:37:31 360
原创 1006 Sign In and Sign Out (25)(25 分)
目录题目:代码:题目:At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of signing...
2018-07-18 15:05:13 220
原创 1005 Spell It Right (20)(20 分)
目录 题目:反思:代码: 题目:Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:Each input ...
2018-07-18 14:23:52 293
原创 输入输出技巧
使int型的1输出为00001 #include<iostream>using namespace std;int main(){ int a = 1; printf("%05d\n", a); return 0;} 关于小数点精确 #include<iostream>#include<iomanip>usin...
2018-07-18 08:55:33 154
原创 <map>
目录 map可以用于代替动态数组,增删查改非常方便map中添加新元素: map可以用于代替动态数组,增删查改非常方便 map中添加新元素: Map[index]=value;Map.insert(pair<与Map相等>,(first,second));...
2018-07-18 08:55:23 204
原创 1004 Counting Leaves (30)(30 分)
目录题目:分析:反思:代码:题目:A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.InputEach input file contains one test case. E...
2018-07-18 08:55:09 855 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人