树链剖分,用zkw线段树维护每条链两个方向上对每一位的变换情况,由于位数较少,可以用两个unsigned long long表示 ...
分类:
其他好文 时间:
2017-08-23 10:24:14
阅读次数:
284
简单背包问题(0032) 简单背包问题(0032) 简单背包问题(0032) Time limit(ms): 1000 Memory limit(kb): 65535 Submission: 5657 Accepted: 1714 Accepted Time limit(ms): 1000 Memo ...
分类:
其他好文 时间:
2017-08-22 18:39:13
阅读次数:
110
给出二叉树的前序遍历和中序遍历,求二叉树的后序遍历…… 作为一个搜索蒟蒻,我真的没有办法很和谐的A掉,但估计过几天就会写有关这个题的和谐的解法……但只是估计…… 下面讲述我的超暴力解法…… 首先,先由前序遍历得到一个父亲节点,然后再由中序遍历得到这个父亲节点的左子树和右子树中的元素(中序遍历中,该点 ...
分类:
其他好文 时间:
2017-08-21 23:02:58
阅读次数:
502
Censor frog is now a editor to censor so-called sensitive words (敏感词). She has a long text p . Her job is relatively simple -- just to find the first ...
分类:
其他好文 时间:
2017-08-21 11:55:43
阅读次数:
251
题目地址:http://www.hustoj.com/oj/problem.php?id=1092 题目描述 Dave以某种方法获取了未来几天美元对德国马克的兑换率。现在Dave只有100美元,请编程序,使Dave通过几天的美元与德国马克的兑换后能得到最多的美元。 Dave以某种方法获取了未来几天美 ...
分类:
编程语言 时间:
2017-08-20 22:27:03
阅读次数:
93
原题链接: http://oj.leetcode.com/problems/word-search/ 这道题非常easy感觉出来是图的题目,事实上本质上还是做深度优先搜索。基本思路就是从某一个元素出发。往上下左右深度搜索是否有相等于word的字符串。这里注意每次从一个元素出发时要重置訪问标记(也就是 ...
分类:
其他好文 时间:
2017-08-20 13:09:31
阅读次数:
152
描述 After winning the annual town competition for best lawn a year ago, Farmer John has grown lazy; he has not mowed the lawn since then and thus his l ...
将数字转成一个字符串即可了。 import java.util.Scanner; public class convertNumber { public static void main(String args[]){ Scanner input=new Scanner(System.in); in ...
分类:
其他好文 时间:
2017-08-19 18:27:02
阅读次数:
137
OJ题号:洛谷2880 思路: 线段树维护区间最大最小值。 ...
分类:
其他好文 时间:
2017-08-19 17:07:03
阅读次数:
157
#include<iostream> #include<memory.h> #define N 10020 using namespace std; int dp[N],pi[N],wi[N]; int max(int a,int b) { return a>b?a:b; } int main() ...
分类:
其他好文 时间:
2017-08-18 18:24:56
阅读次数:
145