摘要: 题目:https://www.luogu.org/problemnew/show/P1155 思路... 看博客:https://www.cnblogs.com/Narh/p/9213825.html 二分图什么的,字典序什么的,考场上怎么想出来... 代码如下: 阅读全文
posted @ 2018-06-22 21:09 Zinn 阅读(164) 评论(0) 推荐(0)
摘要: 题目:https://www.luogu.org/problemnew/show/P2827 思路... 用优先队列模拟做的话,时间主要消耗在每次的排序上; 能不能不要每次排序呢? 关注先后被砍的两条蚯蚓 x 和 y,发现砍完以后,它们的两部分对应还满足原来的大小关系! 从两条蚯蚓出发,可以推知所有 阅读全文
posted @ 2018-06-22 20:24 Zinn 阅读(135) 评论(0) 推荐(0)
摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2763 构建分层图。 代码如下: 写法1(空间略大)(时间很慢): #include<iostream> #include<cstdio> #include<cstring> #include< 阅读全文
posted @ 2018-06-22 15:08 Zinn 阅读(147) 评论(0) 推荐(0)