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.
Note: You can only move either down or right at...
分类:
其他好文 时间:
2014-04-28 10:46:41
阅读次数:
311
Vector 计算 均值(mean) 和 方差(variance)
本文地址: http://blog.csdn.net/caroline_wendy
vector的数组, 计算均值和方差的最简方法.
代码:
double sum = std::accumulate(std::begin(resultSet), std::end(resultSet), 0.0);...
分类:
编程语言 时间:
2014-04-28 10:44:42
阅读次数:
587
Problem Description
Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N!
Input
One N in one line, process to the end of file.
Output
For each N, output N! i...
分类:
其他好文 时间:
2014-04-28 10:36:41
阅读次数:
341
伸展树模版真的好长好长。。。
cut a b c:把第a-1个数伸展到根节点,把第b+1个数伸展到a的右子树,然后把ch[ch[root][1][0]]拿掉,放在剩下的树的第c个节点下。
flip a b:把第a-1个数伸展到根节点,把第b+1个数伸展到a的右子树,然后翻转ch[ch[root][1][0]];
由于会出现操作两边的情况,所以加了两个-1节点。
注意:
1,输出的时候要注...
分类:
其他好文 时间:
2014-04-27 22:31:19
阅读次数:
295
There is no involute formulation concerning factitiously activity of SKB Kontur in this problem. Moreover, there is no formulation at all.
Input
There is the only number N, 1 ≤ N ≤ 109.
O...
分类:
其他好文 时间:
2014-04-27 21:38:05
阅读次数:
544
别人眼中的水题啊!!!
理解题意真是困难啊,以图片形式说明:
/*************************************************************************
File Name: 1030.cpp
Author: yubo
Mail: yuzibode@126.com
Created Time: 2...
分类:
其他好文 时间:
2014-04-27 21:34:00
阅读次数:
358
5KB的代码。。。250+行。。。就错在一个离散化上,郁闷了好久。。。
RANK就是找出第K位是多少
TOP是将某个人移至队首,对中间区间没有影响
QUERY是某个人的位置
则:
TOP:将目标点旋转至根部,然后删除,最后插入到队首
RANK:通过size查找即可,注意每个点的size是区间长度
QUERY:把该点旋转至根部,左子树的大小+1便是结果
...
分类:
其他好文 时间:
2014-04-27 21:23:00
阅读次数:
330
大明A+B
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 7562 Accepted Submission(s): 2667
Problem Description
话说,经过了漫长的一个多月,小明已经成长...
分类:
其他好文 时间:
2014-04-27 21:21:00
阅读次数:
263
前几天去了两个比较牛的互联网公司面试,在sql这块都遇到问题了,哎,可惜呀,先把简单的梳理一下
成绩表 score
1、group by 使用
按某一个维度进行分组
例如:
求每个同学的总分
SELECT student,SUM(score) FROM score GROUP BY student
求每个同学的平均分
SELECT student,AVG(score) FR...
分类:
数据库 时间:
2014-04-27 21:17:59
阅读次数:
614