大意:给一个数组,先求出SUM[I],然后动态的求出1-I的SUM[I]的和, 这题得化公式: 树状数组维护两个和:SUM(A[I])(1#include#include#includeusing namespace std;typedef long long ll;const int N=...
分类:
其他好文 时间:
2014-06-27 17:53:38
阅读次数:
141
Given a triangle, find the minimum path sum from top to bottom. Each step you maymove to adjacent numbers on the row below.For example, given the fol....
分类:
其他好文 时间:
2014-06-27 16:29:58
阅读次数:
188
题目一:求1!+2!+…..+n! 的和的后6位,(注意n的范围)#include using namespace std;const int MAX = 1000000;int getResu(int n){ int sum=0; int temp= 1; for(int i=1; i >n) {...
分类:
其他好文 时间:
2014-06-27 13:47:37
阅读次数:
161
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.
分类:
其他好文 时间:
2014-06-27 12:52:03
阅读次数:
213
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of ...
分类:
其他好文 时间:
2014-06-27 12:27:28
阅读次数:
169
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
分类:
其他好文 时间:
2014-06-27 11:43:25
阅读次数:
173
还不算是难题(嘿嘿,因为我做出来了)
很简单,找到相应的方程式解就是了(中间也犯了一个很2的错误,把9+10+11+...+99写成(1+90)*90/2,改过来后就好了)
不多说,code is below
#include
#include
#include
using namespace std;
int combi(int a,int b)
{
int sum=1;
int...
分类:
其他好文 时间:
2014-06-27 10:45:32
阅读次数:
193
这是一个简单的JSP页面
<%
int i,sum=0;
for( i=1;i
1到100的连续和是:
将该文件保存为example1.jsp 保存到Tomcat 中RooT目录中,然后运行在浏览器中输入 http://localhos...
分类:
Web程序 时间:
2014-06-27 10:04:22
阅读次数:
192
Given a binary tree containing digits from 0-9 only, each root-to-leaf
path could represent a number.
An example is the root-to-leaf path 1->2->3 which represents the number 123.
Find the tota...
分类:
其他好文 时间:
2014-06-27 09:53:29
阅读次数:
208
有工具在手,这题就是一个模板题,就是有点不清楚,最后问的是单个元素的值,它怎么sum求出来的
#include
#include
#include
#include
using namespace std;
#define maxn 1005
int c[maxn][maxn];
int Row, Col;
inline int Lowbit(const int &x)
{
...
分类:
其他好文 时间:
2014-06-27 07:38:00
阅读次数:
281