-
高精度计算(一):大整数加法
高精度计算(一):大整数加法 C/C++中的int 类型能表示的范围是-2 31 ~2 31 1。unsigned 类型能表示的范围是 0 ~2 32 1,即 0~4294967295。所以,int 和unsigned 类型变量,都不能保存超过10 位的整数。 有时我们需要参与运算的数,可能会远远不止10 位,例如要求100...
-
Two Sum
Two Sum Two Sum Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the same element twice. Example: Given nums...
-
Add Two Numbers
Add Two Numbers Add Two Numbers You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked lis...
-
leetcode 136 Single Number bit Option
leetcode 136 Single Number bit Option Linked Url:https://leetcode.com/problems/single-number/ Given anon-emptyarray of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime comp...
-
DFS(四):剪枝策略
DFS(四):剪枝策略 顾名思义,剪枝就是通过一些判断,剪掉搜索树上不必要的子树。在采用DFS算法搜索时,有时候我们会发现某个结点对应的子树的状态都不是我们要的结果,这时候我们没必要对这个分支进行搜索,砍掉这个子树,就是剪枝。 在DFS搜索算法中,剪枝策略就是...
-
HelloWorld! C++纠错版
HelloWorld! C++纠错版 例题: 1 #includeiostream 2 3 int main() 4 { 5 cout " HelloWorel! " ; 6 return 0 ; 7 } 1 #include iostream 2 using namespace std; 3 int main() // c++ programs start by executing the function main 4 { 5 cout " HelloWorld!\n " end...
-
BFS(五):八数码难题 (POJ 1077)
BFS(五):八数码难题 (POJ 1077) Eight Description The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all pa...
-
DFS(二):骑士游历问题
DFS(二):骑士游历问题 在国际象棋的棋盘(8行8列)上放置一个马,按照 马走日字 的规则,马要遍历棋盘,即到达棋盘上的每一格,并且每格只到达一次。例如,下图给出了骑士从坐标(1,5)出发,游历棋盘的一种可能情况。 【例1】骑士游历问题。 编写一个程序,对于给...
-
Can you answer these queries III
Can you answer these queries III Can you answer these queries III 题目:洛谷 SPOJ 【题目描述】 给定长度为N的数列A,以及M条指令,每条指令可能是以下两种之一: 1.0 x y,把A[x]改成y; 2.1 x y,查询区间[x,y]中的最大连续子段和。 【输入格式】 第一行,N; 第...
-
彻底弄懂UTF-8、Unicode、宽字符、locale
彻底弄懂UTF-8、Unicode、宽字符、locale 目录 Unicode、UCS UTF8 结论 宽字符类型wchar_t locale 为什么需要宽字符类型 多字节字符串和宽字符串相互转换 最近使用到了wchar_t类型,所以准备详细探究下,没想到水还挺深,网上的资料大多都是复制粘贴,只有个结论,也没...
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash
