山东济南彤昌机械科技有限公司 山东济南江鹏工贸游有限公司

08 2015 档案

【暑假】[数学]UVa 1262 Password
摘要:UVa 1262 Password题目:PasswordTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %lluSubmit Status DescriptionShoulder-surfing is the behavi... 阅读全文

posted @ 2015-08-26 19:05 hahalidaxin

【暑假】[数学]UVa 10375 Choose and divide
摘要:UVa 10375 Choose and divide题目:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=19601思路: maxn=10000 如果计算maxn!再保存的话显然装不下。 但答案由阶乘的积或商组成,所以可以用唯... 阅读全文

posted @ 2015-08-26 17:28 hahalidaxin

【暑假】[深入动态规划]深入动态规划 知识点总结
摘要:深入动态规划 知识点总结【紫书:竞赛题目选讲】例题9-18 跳舞机UVa 10618:踩下屏幕上出现的箭头,每种移动产生与上次移动有关的费用,求解最小费用。D[i][a][b][s]表示考虑到第i个箭头后左右脚分别位于ab上一次踩下s时的最小费用。对于无要求.有不移动与随便移动两种决策,对... 阅读全文

posted @ 2015-08-22 22:31 hahalidaxin

【暑假】[深入动态规划]UVAlive 4794 Sharing Chocolate
摘要:UVAlive 4794Sharing Chocolate题目:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=12055思路:设d[S][r][c]表示形如r*c的矩形是否可以划分为S中的子集,10表示可否。 转移方程: d... 阅读全文

posted @ 2015-08-22 18:22 hahalidaxin

【暑假】[深入动态规划]UVAlive 3983 Robotruck
摘要:UVAlive 3983Robotruck题目:RobotruckTime Limit:3000MSMemory Limit:Unknown64bit IO Format:%lld & %lluSubmitStatusDescriptionProblem C - RobotruckBackgroun... 阅读全文

posted @ 2015-08-22 11:38 hahalidaxin

【暑假】[深入动态规划]UVa 1628 Pizza Delivery
摘要:UVa 1628Pizza Delivery题目:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=51189思路:本体与修缮长城一题有所相似。所以解法有相似之处。 不同之处就是本体可能会产生负情况,即送餐时间晚了客户会反过来找你... 阅读全文

posted @ 2015-08-21 21:16 hahalidaxin

【暑假】[深入动态规划]UVa 1380 A Scheduling Problem
摘要:UVa 1380A Scheduling Problem题目:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=41557思路:给出一个任务调度树,单向边u->v表示u必须在v之前完成,双向边u-v表示无所谓方向。 题目给出定理,... 阅读全文

posted @ 2015-08-20 12:20 hahalidaxin

【暑假】[深入动态规划]UVa 12170 Easy Climb
摘要:UVa 12170 Easy Climb题目:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=24844思路:引别人一个题解琢磨一下: from:http://blog.csdn.net/glqac/article/detail... 阅读全文

posted @ 2015-08-19 22:16 hahalidaxin

【暑假】[深入动态规划]UVa 10618 The Bookcase
摘要:UVa 12099 The Bookcase题目: http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=42067思路:将n本书分配到三层,使得形成的书架w*h最小 提前将书籍按照高度排序,因为无论第一本书(最高的书)无论放在那一层... 阅读全文

posted @ 2015-08-19 18:13 hahalidaxin

【暑假】[深入动态规划]UVa 10618 Fun Game
摘要:UVa 10618 Fun Game题目: http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=36035思路:一圈人围坐,给出小球的传递序列,求解最少有多少个人。 问题简单化:如果有一排人,单向传递,给出序列求解最少多少人。那么问... 阅读全文

posted @ 2015-08-19 12:43 hahalidaxin

【暑假】[深入动态规划]UVa 10618 Fixing the Great Wall
摘要:UVa 10618Fixing the Great Wall题目:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=36139思路:数轴上有n个点需要修复,每个点有信息c,x,d 表示位于x且在t时修缮的费用是c+d*t,找一个修... 阅读全文

posted @ 2015-08-18 22:58 hahalidaxin

【暑假】[深入动态规划]UVa 1627 Team them up!
摘要:UVa 1627Team them up!题目:Team them up!Time Limit:3000MSMemory Limit:Unknown64bit IO Format:%lld & %lluSubmitStatusDescriptionYour task is to divide a n... 阅读全文

posted @ 2015-08-18 19:35 hahalidaxin

【暑假】[深入动态规划]UVa 10618 Tango Tango Insurrection
摘要:UVa 10618Tango Tango Insurrection题目:Problem A: Tango Tango InsurrectionYou are attempting to learn to play a simple arcade dancing game. The game has ... 阅读全文

posted @ 2015-08-18 11:55 hahalidaxin

【暑假】[深入动态规划]UVa 1412 Fund Management
摘要:UVa 1412Fund Management题目:UVA - 1412Fund ManagementTime Limit:3000MSMemory Limit:Unknown64bit IO Format:%lld & %lluSubmitStatusDescriptionFrank is a p... 阅读全文

posted @ 2015-08-17 11:32 hahalidaxin

【暑假】[实用数据结构]UVAlive 4670 Dominating Patterns
摘要:UVAlive 4670 Dominating Patterns题目:Dominating PatternsTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %lluSubmit Status DescriptionThe ... 阅读全文

posted @ 2015-08-12 21:25 hahalidaxin

【暑假】[实用数据结构]UVAlive 3026 Period
摘要:UVAlive 3026 Period题目:PeriodTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %lluSubmit Status DescriptionFor each prefix of a given str... 阅读全文

posted @ 2015-08-11 20:59 hahalidaxin

【暑假】[实用数据结构]UVAlive 3942 Remember the Word
摘要:UVAlive 3942 Remember the Word题目:Remember the WordTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %lluSubmit Status DescriptionNeal is ... 阅读全文

posted @ 2015-08-11 20:29 hahalidaxin

【暑假】[实用数据结构] AC自动机
摘要:Aho-Corasick自动机算法: AC自动机用于解决文本一个而模板有多个的问题。 AC自动机可以成功将多模板匹配,匹配意味着算法可以找到每一个模板在文本中出现的位置。 KMP中对模板构造失配边,多模板每条模板独立构造失配边太过麻烦。 算法利用Trie+KMP中的失配边。insert(模板)构造... 阅读全文

posted @ 2015-08-10 20:48 hahalidaxin

【暑假】[实用数据结构]KMP
摘要:KMP算法KMP算法是字符串匹配算法,可以在O(n)的时间完成,算法包含两部分,分别是:构造适配函数与两串匹配。失配边的使用大大提高了算法效率,可以理解为已经成功匹配的字符不在重新匹配,因为我们已经知道它是什么,对应到算法中 匹配失败后应该在最大前缀之后继续匹配,因为某后缀已与最大前缀匹配成功而不用... 阅读全文

posted @ 2015-08-10 20:20 hahalidaxin

【暑假】[实用数据结构]前缀树 Trie
摘要:前缀树TrieTrie可理解为一个能够快速插入与查询的集合,无论是插入还是查询所需时间都为O(m)模板如下: 1 const int maxnode = 1000+10; 2 const int sigma_size = 26; 3 4 struct Trie{ 5 int ch[maxnode... 阅读全文

posted @ 2015-08-10 19:35 hahalidaxin

【暑假】[实用数据结构]UVa11235 Frequent values
摘要:UVa 11235 Frequent valuesTime Limit:2000MSMemory Limit:65536KTotal Submissions:11241Accepted:4110DescriptionYou are given a sequence ofnintegersa1, a2... 阅读全文

posted @ 2015-08-07 17:53 hahalidaxin

【暑假】[实用数据结构]UVAlive 4329 Ping pong
摘要:UVAlive 4329Ping pong 题目:Ping pongTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %llu Submit Status DescriptionN(3N20000) ping pong pl... 阅读全文

posted @ 2015-08-07 15:58 hahalidaxin

【暑假】[实用数据结构]UVAlive 3027 Corporative Network
摘要:UVAlive 3027 Corporative Network题目:Corporative NetworkTime Limit: 3000MSMemory Limit: 30000KTotal Submissions: 3450Accepted: 1259DescriptionA very big... 阅读全文

posted @ 2015-08-07 12:37 hahalidaxin

【暑假】[实用数据结构]UVAlive 3644 X-Plosives
摘要:UVAlive X-Plosives思路: “如果车上存在k个简单化合物,正好包含k种元素,那么他们将组成一个易爆的混合物” 如果将(a,b)看作一条边那么题意就是不能出现环,很容易联想到Kruskal算法中并查集的判环功能(新加入的边必须属于不同的两个集合否则出现环),因此本题可以用并查集实现。模... 阅读全文

posted @ 2015-08-07 12:23 hahalidaxin

【暑假】[实用数据结构]UVa11997 K Smallest Sums
摘要:UVa11997 K Smallest Sums题目: K Smallest SumsYou're given k arrays, each array has k integers. There are kkways to pick exactly one element in each arra... 阅读全文

posted @ 2015-08-07 12:08 hahalidaxin

【暑假】[实用数据结构]UVAlive 3135 Argus
摘要:UVAlive 3135 ArgusArgusTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %llu Submit Status DescriptionA data stream is a real-time, cont... 阅读全文

posted @ 2015-08-07 11:26 hahalidaxin

【暑假】[实用数据结构]UVa11991 Easy Problem from Rujia Liu?
摘要:UVa11991 Easy Problem from Rujia Liu?思路:构造数组data,使满足data[v][k]为第k个v的下标。因为不是每一个整数都会出现因此用到map,又因为每个数出现次数不等可能相差很大,因此用到vector。 注意:对于数据的清空与判空不要忘记,而map在调用之... 阅读全文

posted @ 2015-08-07 11:15 hahalidaxin

【暑假】[实用数据结构]UVa11995 I Can Guess the Data Structure!
摘要:UVa11995 I Can Guess the Data Structure!思路:边读边模拟,注意empty的判断!代码如下:#include#include#includeusing namespace std;int main(){queue q;priority_queue pri_q;s... 阅读全文

posted @ 2015-08-07 11:05 hahalidaxin

【暑假】[实用数据结构]动态范围查询问题
摘要:动态范围查询问题:一、线段树+点修改 支持操作:Update(x,v): 将Ax修改为vQuery(L,R) :计算[L,R]内的最小值 1 int minv[maxn]; 2 int ql,qr; 3 int Query(int u,int L,int R){ 4 int M=L + (R... 阅读全文

posted @ 2015-08-06 18:48 hahalidaxin

【暑假】[实用数据结构]范围最小值问题(RMQ)
摘要:范围最小值问题:提供操作:Query(L,R):计算min{AL ~ AR }Sparse-Table算法:定义d[i][j]为从i开始长度为2j的一段元素的最小值。所以可以用递推的方法表示。预处理RMQ_init如下(感觉像区间DP):1 int RMQ_init(const vector& A)... 阅读全文

posted @ 2015-08-06 16:59 hahalidaxin

【暑假】[实用数据结构]动态连续和查询问题
摘要:动态连续和查询问题: 支持操作:Add(x,d):让 Ax 增加 d Query(L,R):计算sum(AL,AR)定义lowbit如下:1 int lowbit(int u){ return u & (-u); }前缀和sum与修改结点add如下: 1 int sum(int u){ 2 ... 阅读全文

posted @ 2015-08-06 16:28 hahalidaxin

【暑假】[基本数据结构]基本的数据结构知识点总结梳理
摘要:基本的数据结构知识点总结梳理数据结构:栈、队列(deque)、链表、树和二叉树、图算法:1、 树的遍历pre_order in_order post_order :递归完成2、 根据in_order与另一种遍历构树:pre_order|post_order寻找根节点,in_order判断左右子树,递... 阅读全文

posted @ 2015-08-04 18:02 hahalidaxin

【暑假】[基本数据结构]根据in_order与post_order构树
摘要:TreeTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %lluSubmit Status DescriptionYou are to determine the value of the leaf node in a g... 阅读全文

posted @ 2015-08-04 17:13 hahalidaxin

【暑假】[基本数据结构]根据BFS与DFS确定树
摘要:UVa10410 Tree Reconstruction算法:根据BFS构造pos数组以区分关系,在此基础上对DFS序列操作。注:栈中存父结点,栈顶是最优先的父结点。代码如下: 1 #include 2 #include 3 #include 4 #define FOR(a,b,c) for(int... 阅读全文

posted @ 2015-08-04 16:54 hahalidaxin