随笔分类 -  动态规划DP

摘要:On his free time, Chouti likes doing some housework. He has got one new task, paint some bricks in the yard. There are nn bricks lined in a row on the 阅读全文
posted @ 2019-04-19 00:59 茄子Min 阅读(399) 评论(0) 推荐(0)
摘要:Time Limit: 2 sec / Memory Limit: 1024 MB Score : 600600 points Problem Statement Snuke has a blackboard and a set SS consisting of NN integers. The i 阅读全文
posted @ 2019-04-17 22:46 茄子Min 阅读(448) 评论(0) 推荐(0)
摘要:D - We Like AGC Time Limit: 2 sec / Memory Limit: 1024 MB Score : 400400 points Problem Statement You are given an integer NN. Find the number of stri 阅读全文
posted @ 2019-04-11 21:07 茄子Min 阅读(381) 评论(0) 推荐(0)
摘要:You are given an integer array of length nn. You have to choose some subsequence of this array of maximum length such that this subsequence forms a in 阅读全文
posted @ 2019-04-08 21:47 茄子Min 阅读(291) 评论(0) 推荐(0)
摘要:As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them: Yuta ha 阅读全文
posted @ 2019-04-07 00:11 茄子Min 阅读(259) 评论(0) 推荐(0)
摘要:Palindromic characteristics of string s with length |s| is a sequence of |s|integers, where k-th number is the total number of non-empty substrings of 阅读全文
posted @ 2019-02-27 21:48 茄子Min 阅读(321) 评论(0) 推荐(0)
摘要:I - Coins Time Limit: 2 sec / Memory Limit: 1024 MB Score : 100100 points Problem Statement Let NN be a positive odd number. There are NN coins, numbe 阅读全文
posted @ 2019-01-16 23:26 茄子Min 阅读(557) 评论(0) 推荐(0)
摘要:E. Selling Souvenirs time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output E. Selling Souvenir 阅读全文
posted @ 2019-01-16 17:58 茄子Min 阅读(379) 评论(0) 推荐(0)
摘要:F - LCS Time Limit: 2 sec / Memory Limit: 1024 MB Score : 100100 points Problem Statement You are given strings ss and tt. Find one longest string tha 阅读全文
posted @ 2019-01-16 12:56 茄子Min 阅读(799) 评论(0) 推荐(0)
摘要:E - Knapsack 2 Time Limit: 2 sec / Memory Limit: 1024 MB Score : 100100 points Problem Statement There are NN items, numbered 1,2,…,N1,2,…,N. For each 阅读全文
posted @ 2019-01-15 23:26 茄子Min 阅读(1106) 评论(0) 推荐(1)
摘要:链接:https://ac.nowcoder.com/acm/contest/342/B来源:牛客网 筱玛的排列 筱玛的排列 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 524288K,其他语言1048576K 64bit IO Format: %lld 时间限制:C/C++ 1 阅读全文
posted @ 2019-01-15 20:10 茄子Min 阅读(349) 评论(0) 推荐(0)
摘要:D - Knapsack 1 Time Limit: 2 sec / Memory Limit: 1024 MB Score : 100100 points Problem Statement There are NN items, numbered 1,2,…,N1,2,…,N. For each 阅读全文
posted @ 2019-01-10 20:10 茄子Min 阅读(566) 评论(0) 推荐(0)
摘要:C - Vacation Time Limit: 2 sec / Memory Limit: 1024 MB Score : 100100 points Problem Statement Taro's summer vacation starts tomorrow, and he has deci 阅读全文
posted @ 2019-01-10 19:40 茄子Min 阅读(741) 评论(0) 推荐(0)
摘要:B - Frog 2 Time Limit: 2 sec / Memory Limit: 1024 MB Score : 100100 points Problem Statement There are NN stones, numbered 1,2,…,N1,2,…,N. For each ii 阅读全文
posted @ 2019-01-09 23:20 茄子Min 阅读(607) 评论(0) 推荐(0)
摘要:A - Frog 1 Time Limit: 2 sec / Memory Limit: 1024 MB Score : 100100 points Problem Statement There are NN stones, numbered 1,2,…,N1,2,…,N. For each ii 阅读全文
posted @ 2019-01-09 22:52 茄子Min 阅读(1078) 评论(0) 推荐(0)
摘要:题目链接 非常好的一道题目, 分析,如果用暴力的话,时间复杂度是O(q*n)稳稳的超时 如果用二维DP的话,需要O (n*n)的空间复杂度,会爆空间。 那么分析一下,如果k>sqrt(n)的话,不需要sqrt(n) 次就可以达到大于n 而如果k<sqrt(n)的情况下,不妨用DP来处理,时间复杂度和 阅读全文
posted @ 2019-01-06 15:27 茄子Min 阅读(246) 评论(0) 推荐(0)