![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
贪心
ffutop
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #398 B. The Queue
DescriptionFinally! Vasya have come of age and that means he can finally get a passport! To do it, he needs to visit the passport office, but it’s not that simple. There’s only one receptionist at the原创 2017-02-18 20:17:15 · 313 阅读 · 0 评论 -
Code Jam 2017 Qualification Round Problem A. Oversized Pancake Flipper
Problem A. Oversized Pancake Flipper题意给定字符串 S (仅由 + 或 - 组成)和 K ,存在一种操作:将串 S 中连续 K 个字符进行反转( + 变成 - 以及 - 变成 + )。问最少进行多少次上述操作,可以把串 S 变成全由 + 组成。解法首先考虑对于任意区间 [i, i+K-1] ,作奇数次操作与作 1 次操作的结果相同,作偶数次操作与不作操作结果相同。原创 2017-04-09 10:05:33 · 604 阅读 · 0 评论 -
Code Jam 2017 Qualification Round Problem D. Fashion Show
Problem D. Fashion Show题意You are about to host a fashion show to show off three new styles of clothing. The show will be held on a stage which is in the most fashionable of all shapes: an N-by-N grid o原创 2017-04-10 10:26:48 · 916 阅读 · 0 评论 -
ZOJ 3953 Intervals (贪心)
Chiaki has n intervals and the i-th of them is [li,ri][l_i, r_i]. She wants to delete some intervals so that there does not exist three intervals a, b and c such that a intersects with b, b intersects原创 2017-04-12 16:37:40 · 668 阅读 · 0 评论 -
ZOJ 3963 Heap Partition(贪心)
A sequence S={s1,s2,...,sn}S = \{s_1, s_2, ..., s_n\} is called heapable if there exists a binary tree T with n nodes such that every node is labelled with exactly one element from the sequence S, and原创 2017-04-23 13:36:49 · 2100 阅读 · 0 评论 -
Codeforces Round #412 D. Dynamic Problem Scoring (枚举 + 贪心)
Vasya and Petya take part in a Codeforces round. The round lasts for two hours and contains five problems.For this round the dynamic problem scoring is used. If you were lucky not to participate in any原创 2017-05-08 15:57:59 · 827 阅读 · 1 评论 -
HDU 6090 Rikka with Graph (贪心+构造, 2017 Multi-Univ Training Contest 5)
Problem图上两点间距离被定义为 disti,jdist_{i,j} 为两点间最短路距离(任意直接相连两点距离为 1 ),若两点不连通,则记 disti,jdist_{i,j} 为该图中点数 n 。要求构造一个 n 点 m 条边的图 G ,使得 ∑ni=1∑nj=1disti,j\sum_{i=1}^n\sum_{j=1}^n dist_{i,j} 最小。Limit1≤n≤1061\le n\原创 2017-08-09 13:54:06 · 484 阅读 · 0 评论