Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.N...
分类:
其他好文 时间:
2014-08-25 20:41:44
阅读次数:
192
时间限制:1.25s空间限制:6M题意: 给出n*n的矩阵(n#include using namespace std;int Gx[5009][2], Gy[5009][2];int color[5009];int n, m, sum;char c;void make (int p, int...
分类:
其他好文 时间:
2014-08-25 18:50:54
阅读次数:
165
1常用数据库聚合函数max()min()sum()avg()count()2字符串处理函数len() 与 datalength() 区别:len是返回字符长度 datalength是返回字节长度LTrim() RTrim() Trim ()isnull(@FilterStr,N'')如果时空将其替换...
分类:
数据库 时间:
2014-08-25 18:39:14
阅读次数:
276
#include<iostream>
#include<cmath>
usingnamespacestd;
doublefac(intn)
{
if(0==n)
return1;
elseif(1==n)
return1;
else
returnn*fac(n-1);
}
intmain()
{
doublex,sum;
charans;
do
{
cout<<"Pleaseinputthex:\n";
cin>>x;
cout<<"The..
分类:
其他好文 时间:
2014-08-25 17:14:45
阅读次数:
190
Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".思路: 1 class Solution { 2 public: 3 strin...
分类:
其他好文 时间:
2014-08-25 16:58:34
阅读次数:
188
题目链接The problem is quite simple. You're given a number N and a positive integer K. Tell if N can be represented as a sum of K prime numbers (not neces...
分类:
其他好文 时间:
2014-08-25 13:19:04
阅读次数:
270
Problem 34
145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145.
Find the sum of all numbers which are equal to the sum of the factorial of their digits.
Note: as 1! = 1 and 2! = 2 are...
分类:
其他好文 时间:
2014-08-25 11:59:14
阅读次数:
243
Little Hasan loves to play number games with his friends.One day they were playing a game where one of them will speak out a positive numberand the others have to tell the sum of its factors. The firs...
分类:
其他好文 时间:
2014-08-25 11:57:04
阅读次数:
235
一个线段树问题节点记录这样几个值,sum(这个区间的总和),best(这个区间中的最大值),lazy(翻倍的lazy标记)这里的[a,b]区间代表数为a与b之间的那些东西,因为无论怎么弄这些相同数字的都是连续的 1 #include 2 #include 3 #include 4 #i...
分类:
其他好文 时间:
2014-08-25 11:28:34
阅读次数:
242
Problem 36
The decimal number, 585 = 10010010012 (binary), is palindromic in both bases.
Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2.
(Please...
分类:
其他好文 时间:
2014-08-25 10:06:04
阅读次数:
198