动态规划
文章平均质量分 76
FFOYeah
这个作者很懒,什么都没留下…
展开
-
# LIS # POJ 1836 Alignment
POJ 1836Description In the army, a platoon is composed by n soldiers. During the morning inspection, the soldiers are aligned in a straight line in front of the captain. The captain is not satisfie原创 2018-01-29 00:10:12 · 265 阅读 · 0 评论 -
#dp# 2018-2019 ACM-ICPC, NEERC, Southern Subregional Contest, Qualification Stage
K. Medians and Partition代码:#include <cstdio>#include <cstring>#include <string>#include <cmath>#include <cstdlib&am原创 2018-10-17 01:11:15 · 959 阅读 · 2 评论 -
#递归、DP# 2749: 分解因数
题目链接:http://bailian.openjudge.cn/practice/2749/描述给出一个正整数a,要求分解成若干个正整数的乘积,即a = a1 * a2 * a3 * ... * an,并且1 < a1 <= a2 <= a3 <= ... <= an,问这样的分解的种数有多少。注意到a = a也是一种分解。输入第1行是测试数据的组数...原创 2018-09-17 21:55:58 · 396 阅读 · 1 评论 -
"字节跳动杯"2018中国大学生程序设计竞赛-女生专场(ing)
1002. 口算训练题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6287Problem Description小Q非常喜欢数学,但是他的口算能力非常弱。因此他找到了小T,给了小T一个长度为n的正整数序列a1,a2,...,an,要求小T抛出m个问题以训练他的口算能力。每个问题给出三个正整数l,r,d,小Q需要通过口算快速判断al×al...原创 2018-08-24 23:25:47 · 837 阅读 · 0 评论 -
#概率01背包# HDU 2955 Robberies
题目链接RobberiesThe aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because they become too greedy. He has decided to work...原创 2018-07-14 23:15:57 · 201 阅读 · 0 评论 -
#DP# Codeforces Round #374 (Div. 2) C. Journey
题目链接Recently Irina arrived to one of the most famous cities of Berland — the Berlatov city. There are n showplaces in the city, numbered from 1to n, and some of them are connected by one-directional...原创 2018-07-25 23:08:36 · 207 阅读 · 0 评论 -
#dp# Codeforces D. Yet Another Problem On a Subsequence
题目链接D. Yet Another Problem On a Subsequencetime limit per test 2 secondsmemory limit per test 256 megabytesThe sequence of integers a1,a2,…,aka1,a2,…,ak is called a good array if a1=k−1a1=k−...原创 2018-07-23 22:53:58 · 377 阅读 · 0 评论 -
#矩阵前缀和# Codeforces C. Star sky
题目链接:http://codeforces.com/problemset/problem/835/CC. Star skytime limit per test 2 secondsmemory limit per test 256 megabytesThe Cartesian coordinate system is set in the sky. There you c...原创 2018-07-17 01:17:07 · 353 阅读 · 0 评论 -
#最短路、gcd、DP# 2017杭州女生赛
C. Coprime Sequence题目链接Problem Description Do you know what is called Coprime Sequence”? That is a sequence consists of n positive integers, and the GCD (Greatest Common Divisor) of them is equ...原创 2018-05-15 20:18:18 · 425 阅读 · 0 评论 -
【数论】【DP】【LCM】2018 USP-ICMC【待补】
比赛传送门A. Nicoleta and the circle of kidsDescription每个人可以连边,最远连到第(i+k)%n 个人,边权为两个人之间的距离,求最大生成树Range1 ≤ K < N ≤ 1e9Solution方案一:LCM如果每个人都选取最优的连边策略,假设在人数可以无限扩大的前提下,那么每个人都可以向接下来的第k个人连边,很容易得出一个循环节...原创 2019-04-15 01:28:54 · 515 阅读 · 6 评论