Xenia the beginner mathematician is a third year student at elementary school. She is now learning the addition operation.
The teacher has written down the sum of multiple numbers. Pupils should ca...
分类:
其他好文 时间:
2014-07-22 23:05:53
阅读次数:
382
题目链接:1484 - Alice and Bob's Trip
题意:BOB和ALICE这对狗男女在一颗树上走,BOB先走,BOB要尽量使得总路径权和大,ALICE要小,但是有个条件,就是路径权值总和必须在[L,R]之间,求最终这条路径的权值。
思路:树形dp,dp[u]表示在u结点的权值,往下dfs的时候顺带记录下到根节点的权值总和,然后如果dp[v] + w + sum 在[l,r]内,...
分类:
其他好文 时间:
2014-07-22 23:05:33
阅读次数:
486
题目链接:
http://poj.org/problem?id=1707
Language:
Default
Sum of powers
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 735
Accepted: 354
D...
分类:
其他好文 时间:
2014-05-01 18:36:32
阅读次数:
385
1.标准查询符
在C#3.0之后微软对集合进行了非常大的改造,使用了查询符进行集合的查询,这一切都来自.NetFramework 对Lambda表达式的支持。标准查询符,一共有两种类型是支持泛型和不支持泛型的,因为引入泛型的目的在于写出公用的代码,避免代码累赘。
注意,除非赋值给变量的类型是一眼就能看出来的,否则就应该只有在声明类型的时候指定隐式类型的变量(var)。
在System...
分类:
其他好文 时间:
2014-05-01 17:43:22
阅读次数:
487
Max Sum
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 135262 Accepted Submission(s): 31311
Problem Description
Given a sequen...
分类:
其他好文 时间:
2014-04-30 22:21:40
阅读次数:
280
今天在写栈碰到 了一个问题关于c语言参数传递的让我郁闷了半天
我只发现了两个问题一个
实参sum(a,b)
形参sum(int a,int b)或者sum(int &a,int &b)
实参sum(&a,&b)
形参sum(int *a,int *b)
这个就是c函数传地址与传引用传值!...
分类:
编程语言 时间:
2014-04-29 13:38:21
阅读次数:
271
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LinqToEntity
{
class Program
{
static void Main(string[] args)
{
//...
分类:
其他好文 时间:
2014-04-29 13:16:21
阅读次数:
574
代码来自于这里
https://code.google.com/p/stanford-cs193g-sp2010/source/browse/trunk/tutorials/sum_reduction.cu...
分类:
其他好文 时间:
2014-04-29 13:13:20
阅读次数:
324
Given two binary strings, return their sum (also a binary string).
For example,
a = "11"
b = "1"
Return "100".
思路同十进制的大数相加。代码如下:
class Solution {
public:
string addBinary(string a, str...
分类:
其他好文 时间:
2014-04-29 13:12:20
阅读次数:
328