2017年10月10日

HDU 6208 (字符串hash)

摘要: 题目链接: http://acm.split.hdu.edu.cn/showproblem.php?pid=6208 题意:给你n个串,能不能在这n个串中找到一个串,使得其它所有的串都是这个串的子串。 题解:找到最长的串作为主串,将主串hash一下,然后去匹配其它串即可 代码: 1 #pragma 阅读全文

posted @ 2017-10-10 19:26 Jstyle 阅读(306) 评论(0) 推荐(1) 编辑

2017年4月15日

2015-2016 ACM-ICPC Pacific Northwest Regional Contest (Div. 2)

摘要: A: 英语阅读题,没读懂题意,这个题出的严重不好,有兴趣的可以做一下,从后往前求即可; B: 题让你求每一步操作之后能mess up的数字(1-100)。每一步操作可能是加减乘除,mess up的定义是出现负数或者小数。 按照题意进行模拟就行了,注意坑点:mess up的数字不会再次进行操作。(比如 阅读全文

posted @ 2017-04-15 19:33 Jstyle 阅读(695) 评论(0) 推荐(0) 编辑

2017年4月3日

2016-2017 ACM-ICPC Pacific Northwest Regional Contest (Div. 2) 【部分题解】

摘要: A:因为删除是不计入操作次数的,所以转化一下就是求最长上升子序列,简单dp。 设dp[i]表示前i个字符能凑成上升子序列的最大长度,dp[i] = max(dp[j]+1, dp[i]) 【j < i && s[j] < s[i]】 1 #include <bits/stdc++.h> 2 usin 阅读全文

posted @ 2017-04-03 17:48 Jstyle 阅读(1435) 评论(0) 推荐(0) 编辑

2017年2月21日

codeforces 743D【数dp】

摘要: 链接:http://codeforces.com/contest/743/problem/D 题意: 给定n个结点的树的每个结点的权值,让你找到两个不相交的子树的最大权值和;1为根节点; 题解: 首先了解一下子树的概念,百度一下就出来了。考虑以u为根结点的子树的最大权值,两种情况: 1.包含u的时候 阅读全文

posted @ 2017-02-21 23:18 Jstyle 阅读(211) 评论(0) 推荐(0) 编辑

2017年2月16日

HDU - 1542【离散化+线段树+扫描线】

摘要: Atlantis Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11997 Accepted Submission(s): 5056 Probl 阅读全文

posted @ 2017-02-16 18:59 Jstyle 阅读(190) 评论(0) 推荐(0) 编辑

2017年2月14日

HDU - 4614 【二分+线段树维护】

摘要: Vases and Flowers Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 3263 Accepted Submission(s): 12 阅读全文

posted @ 2017-02-14 11:16 Jstyle 阅读(204) 评论(0) 推荐(0) 编辑

2017年2月11日

HDU - 1428【bfs+记忆化】

摘要: 点击查看详情——《IJCAI 2017 口碑商家客流量预测大赛》 漫步校园 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4205 Accept 阅读全文

posted @ 2017-02-11 16:48 Jstyle 阅读(217) 评论(0) 推荐(0) 编辑

2017年2月8日

codeforces - 766D【Double 并查集】

摘要: D. Mahmoud and a Dictionary time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Mahmoud want 阅读全文

posted @ 2017-02-08 20:07 Jstyle 阅读(332) 评论(0) 推荐(0) 编辑

codeforces - 766C【dp】

摘要: C. Mahmoud and a Message time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output C. Mahmoud and 阅读全文

posted @ 2017-02-08 19:54 Jstyle 阅读(297) 评论(0) 推荐(0) 编辑

codeforces - 766B【三角形判断】

摘要: B. Mahmoud and a Triangle time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mahmoud has n 阅读全文

posted @ 2017-02-08 19:44 Jstyle 阅读(687) 评论(0) 推荐(0) 编辑

2017年2月7日

HDU 6012【离散化+扫描线】

摘要: Lotus and Horticulture Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 698 Accepted Submission( 阅读全文

posted @ 2017-02-07 19:19 Jstyle 阅读(322) 评论(0) 推荐(0) 编辑

2017年2月3日

codeforces 764C【dfs】

摘要: C. Timofey and a tree time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Each New Year Timo 阅读全文

posted @ 2017-02-03 20:50 Jstyle 阅读(268) 评论(0) 推荐(0) 编辑

BZOJ - 1015【并查集】

摘要: 1015: [JSOI2008]星球大战starwar Description 很久以前,在一个遥远的星系,一个黑暗的帝国靠着它的超级武器统治者整个星系。某一天,凭着一个偶然的 机遇,一支反抗军摧毁了帝国的超级武器,并攻下了星系中几乎所有的星球。这些星球通过特殊的以太隧道互相直 接或间接地连接。 但 阅读全文

posted @ 2017-02-03 20:44 Jstyle 阅读(231) 评论(0) 推荐(0) 编辑

BZOJ - 1011【乱搞】

摘要: 1011: [HNOI2008]遥远的行星 Description 直线上N颗行星,X=i处有行星i,行星J受到行星I的作用力,当且仅当i<=AJ.此时J受到作用力的大小为 Fi->j= Mi*Mj/(j-i) 其中A为很小的常量,故直观上说每颗行星都只受到距离遥远的行星的作用。请计算每颗行星的受力 阅读全文

posted @ 2017-02-03 20:41 Jstyle 阅读(194) 评论(0) 推荐(0) 编辑

2017年1月30日

51nod - 1022【四边形不等式优化DP】

摘要: 1022 石子归并 V2 基准时间限制:1 秒 空间限制:131072 KB 分值: 160 难度:6级算法题 收藏 关注 收藏 关注 N堆石子摆成一个环。现要将石子有次序地合并成一堆。规定每次只能选相邻的2堆石子合并成新的一堆,并将新的一堆石子数记为该次合并的代价。计算将N堆石子合并成一堆的最小代 阅读全文

posted @ 2017-01-30 20:50 Jstyle 阅读(232) 评论(0) 推荐(0) 编辑

导航