Dancepted

Dancing Acceped!

2018年10月15日

P1242 新汉诺塔(搜索+模拟退火)

摘要: 题目链接:传送门 题目大意: 汉诺塔,给定n个盘子(n <= 45),起始状态和结束状态,求最小的步数以及路径。 思路: 考虑用dfs贪心地将剩余最大盘归位。 #include<bits/stdc++.h> using namespace std; const int MAX_N = 50; con 阅读全文

posted @ 2018-10-15 23:21 Danceped 阅读(910) 评论(0) 推荐(0) 编辑

P1441 砝码称重(搜索+队列dp)

摘要: 题目链接:传送门 题目大意: 给你n个砝码ai,从中去掉m个后求最多的砝码可表示的重量。 n≤20,m≤4,m<n,ai≤100。 思路: 用dfs搜掉m个砝码,然后用队列dp跑出答案,维护答案。 时间复杂度是O(Cnm * na)。 #include <bits/stdc++.h> using n 阅读全文

posted @ 2018-10-15 22:34 Danceped 阅读(284) 评论(0) 推荐(0) 编辑

从决定打到大四的那天起

摘要: 9.28秦皇岛CCPC打铁归来。 进ACM俱乐部已经一年多了,竟然落得如此下场。。。 DA和队友痛定思痛,痛改前非。。。 话不多说,刷题吧! 2019年1月15日 Codeforces1100E. Andrew and Taxi(拓扑排序) Codeforces1100F. Ivan and Bur 阅读全文

posted @ 2018-10-15 22:23 Danceped 阅读(621) 评论(3) 推荐(0) 编辑

Codeforces Round #516(Div 2)

摘要: 比赛链接:传送门 A. Make a triangle!(简单思维) 题目大意: 给你三条边,问你最多加多少长度能使这三条边能构成三角形。 思路: 最大边小于答案加另外两条边的和。 #include <bits/stdc++.h> using namespace std; int main() { 阅读全文

posted @ 2018-10-15 16:16 Danceped 阅读(323) 评论(0) 推荐(1) 编辑

导航