这种类似大整数的处理的问题还是比较常见的,这道题应该是非常简单的版本。
题目的要求是这样的,输入的vector靠前的位置是数字的高位,因此应该先求出长度,然后从后面往前算。维护一个变量保存进位,这我就不说了。结果的vector怎么办呢?因为最后有可能有个总的进位,比如999加1,结果的vector会比输入的多出一位,因此结果还是从前往后存简单一些。最后如果有进位,就多push_back一个1,然...
分类:
其他好文 时间:
2014-05-14 00:31:48
阅读次数:
312
hash_map和map的用法很相似,只是底层机制有所不同。
hash_map容器采用的底层机制是hash table代码:
template ,
class EqualKey = equal_to,
class Alloc = alloc>
class hash_map
{
private:
typedef hashtable, Key...
分类:
其他好文 时间:
2014-05-13 22:59:23
阅读次数:
256
Given an array, for example, 246135, an inversion pair is the pair whose first value is larger than its second value according to the sequence from left to right, (2,1) (4,1) (4,3) (6,1) (6,3) (6,5)....
分类:
其他好文 时间:
2014-05-13 08:03:58
阅读次数:
338
Pat1016代码
题目描述:
A long-distance telephone company charges its customers by the following rules:
Making a long-distance call costs a certain amount per minute, depending on the time of day w...
分类:
其他好文 时间:
2014-05-13 06:45:05
阅读次数:
460
容器hash_set是以hash table为底层机制的,几乎所有的操作都是转调用hash table提供的接口。由于插入无法存储相同的键值,所以hash_set的插入操作全部都使用hash table的insert_unique接口,代码如下:
pair insert(const value_type& obj)
{
pair p = rep.insert_unique(obj);
...
分类:
其他好文 时间:
2014-05-13 06:33:44
阅读次数:
303
/*
ID:kevin_s1
PROG:dualpal
LANG:C++
*/
#include
#include
#include
#include
#include
using namespace std;
int N,S;
vector result;
bool isPalindromic(string num){
bool flag = true;
int len =...
分类:
其他好文 时间:
2014-05-13 06:10:09
阅读次数:
312
HTTP请求中,如果是get请求,那么表单参数以name=value&name1=value1的形式附到url的后面,如果是post请求,那么表单参数是在请求体中,也是以name=value&name1=value1的形式在请求体中。通过chrome的开发者工具可以看到如下(这里是可读的形式,不是真正的HTTP请求协议的请求格式):
get请求:
RequestURL:http://127....
分类:
其他好文 时间:
2014-05-13 05:59:56
阅读次数:
353
本段程序主要利用数据结构栈的先进后出特点,实现回溯求解迷宫路径问题。
#include
#include
using namespace std;
//坐标类
struct Point
{
int x;
int y;
};
//地图类
template
struct Map
{
int (*p)[A];
int row;//行数
int col;//列数
};
//start起始点, ...
分类:
其他好文 时间:
2014-05-13 05:25:02
阅读次数:
478
集合基础知识数组:长度固定,可存基本数据和对象。集合:只能放对象,不固定。容器也有共性,不断抽取成一个体系,集合框架。参阅顶层创建底层。顶层是collection。collection里有两个常见的接口,List和Set。常见集合有Arraylist,linkedlist,vector,hashSetTreeSet.为什么..
分类:
其他好文 时间:
2014-05-13 03:35:07
阅读次数:
371
keyboard.S 部分代码分析(key_map)
keyboard中间有这么一段,我一开始没看明白,究竟啥意思
key_map:
.byte 0,27
.ascii "1234567890-="
.byte 127,9
.ascii "qwertyuiop[]"
.byte 13,0
.ascii "asdfghjkl;'"
.byte '`,0
.ascii ...
分类:
系统相关 时间:
2014-05-12 22:41:23
阅读次数:
701