https://codeforces.com/gym/102411/problem/M ICPC 2019-2020 North-Western Russia Regional Contest ...
分类:
其他好文 时间:
2019-11-15 20:26:40
阅读次数:
51
题意:x轴上有n个人,让你放置m个集合点,使得每个人往离他最近的集合点走,所有人走的距离和最短。 把距离视为花费,设$dp[i][k]$表示前i个人分成k段的最小花费,则有递推式$dp[i][k]=min\{dp[j][k-1]+w(j,i)\}$,其中$w(j,i)$可以$O(1)$求出。 显然, ...
分类:
其他好文 时间:
2019-11-09 11:35:47
阅读次数:
120
链接: https://codeforces.com/gym/102394/problem/J 题意: The great mathematician DreamGrid proposes a conjecture, which states that: Every positive integer ...
分类:
其他好文 时间:
2019-11-05 13:52:30
阅读次数:
139
链接: https://codeforces.com/gym/102394/problem/I 题意: DreamGrid has an interesting permutation of 1,2,…,n denoted by a1,a2,…,an. He generates three sequ ...
分类:
其他好文 时间:
2019-11-05 13:52:03
阅读次数:
124
链接: https://codeforces.com/gym/102394/problem/F 题意: Harbin, whose name was originally a Manchu word meaning "a place for drying fishing nets", grew fr ...
分类:
其他好文 时间:
2019-11-05 13:36:58
阅读次数:
154
链接: https://codeforces.com/gym/102394/problem/K 题意: DreamGrid is the keeper of n rabbits. Initially, the i th (1≤i≤n) rabbit has a weight of wi. Every ...
分类:
其他好文 时间:
2019-11-05 13:26:23
阅读次数:
140
http://codeforces.com/gym/102394/problem/F F. Fixing Banners time limit per test 1 second memory limit per test 512 megabytes input standard input out ...
分类:
其他好文 时间:
2019-11-04 00:12:49
阅读次数:
112
题意:http://codeforces.com/gym/102394/problem/E 1操作是给你一串数,2操作是连结两个串(所以可能很长),问你最后一个串的值(知道最多的个数就很好算,关键计算个数) 思路: 对二操作建图,一开始还以为建出来的是树就可以直接BFS计算次数,自闭了好久,最后才发 ...
分类:
其他好文 时间:
2019-11-03 12:28:19
阅读次数:
330
https://vjudge.net/problem/Gym-102346A 题意:判断监控器的范围能不能阻断左下角和右上角。 分析:利用并查集处理图,能连接起来的监控器合并起来,然后在最后标记每个集合能否连接到左下、右上、左右、上下的边界形成阻断。 注意: 每个集合可以用 find( x ) 到的 ...
分类:
其他好文 时间:
2019-11-03 01:01:28
阅读次数:
173
https://vjudge.net/problem/Gym-102346M 一般来说, 若题目要求输出一个确定的数( 比如最小天数,最大个数之类 ),用二分来枚举答案试试。 ...
分类:
其他好文 时间:
2019-11-03 00:58:00
阅读次数:
132