随笔分类 - dp
摘要:1202 子序列个数 基准时间限制:1 秒 空间限制:131072 KB 1202 子序列个数 基准时间限制:1 秒 空间限制:131072 KB 1202 子序列个数 基准时间限制:1 秒 空间限制:131072 KB 子序列的定义:对于一个序列a=a[1],a[2],......a[n]。则非空
阅读全文
摘要:1391 01串 题目来源: Codility 基准时间限制:1 秒 空间限制:131072 KB 给定一个01串S,求出它的一个尽可能长的子串S[i..j],满足存在一个位置i<=x <=j, S[i..x]中0比1多,而S[x + 1..j]中1比0多。求满足条件的最长子串长度。 给定一个01串
阅读全文
摘要:1241 特殊的排序 题目来源: 摩根斯坦利的比赛题 基准时间限制:1 秒 空间限制:131072 KB 一个数组的元素为1至N的整数,现在要对这个数组进行排序,在排序时只能将元素放在数组的头部或尾部,问至少需要移动多少个数字,才能完成整个排序过程? 例如: 2 5 3 4 1 将1移到头部 =>
阅读全文
摘要:1055 最长等差数列 基准时间限制:2 秒 空间限制:262144 KB 1055 最长等差数列 基准时间限制:2 秒 空间限制:262144 KB 1055 最长等差数列 基准时间限制:2 秒 空间限制:262144 KB N个不同的正整数,找出由这些数组成的最长的等差数列。 例如:1 3 5
阅读全文
摘要:1670 打怪兽 题目来源: 原创 基准时间限制:1 秒 空间限制:131072 KB 1670 打怪兽 题目来源: 原创 基准时间限制:1 秒 空间限制:131072 KB 1670 打怪兽 题目来源: 原创 基准时间限制:1 秒 空间限制:131072 KB lyk在玩一个叫做“打怪兽”的游戏。
阅读全文
摘要:1043 幸运号码 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 1043 幸运号码 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 1043 幸运号码 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 1个长度为2N的数,如果左边N个数的和 =
阅读全文
摘要:(UVA)11361 - Investigating Div-Sum Property 思路:记忆化搜索; 因为所有位置上的数字加起来和不会超过99的,所以k的有效值<100,所以当k>=100时,答案为0, 然后dp[i][j][k][s],表示在状i下,前j位上数表示的数对mod取模为k,前j位
阅读全文
摘要:1057 - Collecting Gold PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Finally you found the city of Gold. As you are fond
阅读全文
摘要:1036 - A Refining Company PDF (English) Statistics Forum Time Limit: 3 second(s) Memory Limit: 32 MB Its year 2200, planet Earth is out of resources a
阅读全文
摘要:D. Puzzles Barney lives in country USC (United States of Charzeh). USC has n cities numbered from 1 through n and n - 1 roads between them. Cities and
阅读全文
摘要:1193 - Dice (II) PDF (English) Statistics Forum Time Limit: 3 second(s) Memory Limit: 32 MB You have N dices; each of them has K faces numbered from 1
阅读全文
摘要:1119 - Pimp My Ride PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Today, there are quite a few cars, motorcycles, trucks
阅读全文
摘要:1033 - Generating Palindromes PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB By definition palindrome is a string which is
阅读全文
摘要:1025 - The Specials Menu PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Feuzem is an unemployed computer scientist who spe
阅读全文
摘要:1030 - Discovering Gold PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB You are in a cave, a long cave! The cave can be rep
阅读全文
摘要:1021 - Painful Bases PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB As you know that sometimes base conversion is a painfu
阅读全文
摘要:1018 - Brush (IV) PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Mubashwir returned home from the contest and got angry af
阅读全文
摘要:1017 - Brush (III) PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Samir returned home from the contest and got angry after
阅读全文
摘要:C. Alyona and the Tree time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Alyona decided to
阅读全文
摘要:1084 - Winter PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Winter is coming. In a land far away, N men are spending the
阅读全文

浙公网安备 33010602011771号