Pie
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 10309
Accepted: 3651
Special Judge
Description
My birthday is coming up and traditionally I'm servi...
分类:
其他好文 时间:
2014-08-09 15:53:58
阅读次数:
214
问题描述:The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie co...
分类:
其他好文 时间:
2014-08-09 15:49:08
阅读次数:
292
方式一:
BigDecimal.setScale用于格式化小数点
setScale(1)表示保留以为小数,默认用四舍五入方式
setScale(1,BigDecimal.ROUND_DOWN)直接删除多余的小数位,如2.35会变成2.3
setScale(1,BigDecimal.ROUND_UP)进位处理,2.35变成2.4
setSca...
分类:
编程语言 时间:
2014-08-09 11:44:27
阅读次数:
250
Alex doesn't like boredom. That's why whenever he gets bored, he comes up with games. One long winter evening he came up with a game and decided to play it.
Given a sequence a consisting of n integ...
分类:
其他好文 时间:
2014-08-09 11:42:48
阅读次数:
311
解题报告
题意:
原本区间1到n都是1,区间成段改变成一个值,求最后区间1到n的和。
思路:
线段树成段更新,区间去和。
#include
#include
#include
using namespace std;
int sum[500000],lz[500000];
void push_up(int root,int l,int r)
{
sum[root]=sum...
分类:
其他好文 时间:
2014-08-09 11:39:47
阅读次数:
343
Follow up for "Search in Rotated Sorted Array":
What if duplicates are allowed?
Would this affect the run-time complexity? How and why?
Write a function to determine if a given target is in the...
分类:
其他好文 时间:
2014-08-09 11:38:57
阅读次数:
147
解题报告
题意:
略
思路:
线段树成段更新,区间求和。
#include
#include
#include
#define LL long long
#define int_now int l,int r,int root
using namespace std;
LL sum[500000],lazy[500000];
void push_up(int root,int l,...
分类:
其他好文 时间:
2014-08-09 00:18:46
阅读次数:
470
看到Palindrome的题目,首先想到的应该是中心问题,然后从中心出发,思考如何解决。
DP问题一般是从更加小的问题转化到更加大的问题,然后是从地往上 bottom up地计算答案的。
能得出状态转移方程就好办了,本题的状态转移方程是:
if (cowID[i] == cow{j]) tbl[id][i] = tbl[id][i+1];//相等的时候无需改动
else tbl[id][i...
分类:
其他好文 时间:
2014-08-09 00:14:16
阅读次数:
344
Unique Paths IIFollow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle an...
分类:
其他好文 时间:
2014-08-08 23:55:17
阅读次数:
263
Binary Tree Level Order Traversal IIGiven a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level...
分类:
其他好文 时间:
2014-08-08 23:53:16
阅读次数:
221