摘要: https://ac.nowcoder.com/acm/contest/7055 B-Icebound and Squence 思路:递归 AC代码: #include<iostream> #include<cstdio> #include<algorithm> using namespace st 阅读全文
posted @ 2020-08-14 16:05 清水仙 阅读(99) 评论(0) 推荐(0) 编辑
摘要: dp题单:https://ac.nowcoder.com/acm/problem/collection/576? 0星 滑雪 dfs更简单,按照题意。 AC代码: #include<iostream> #include<cstdio> #include<algorithm> using namesp 阅读全文
posted @ 2020-08-12 15:38 清水仙 阅读(157) 评论(0) 推荐(0) 编辑
摘要: https://vjudge.net/contest/367192#problem/A 思路:我想的是利用类似链表的思想,在bfs中每次更新时符合要求的位置咬住原来的位置,ma[5*(x-1)+y]=5*(cur.x-1)+cur.y,以终点为起点,最后倒序输出。 AC代码: #include<io 阅读全文
posted @ 2020-04-09 22:35 清水仙 阅读(137) 评论(0) 推荐(1) 编辑
摘要: https://ac.nowcoder.com/acm/contest/5086/E题意:一串数字只有7和4,称之为幸运数字。给一个区间(包括端点)和一个函数next(x),即大于x的第一个幸运数字。求区间内的next(x)的和。 思路:打表,然后运用前缀和进行优化。 #include<iostre 阅读全文
posted @ 2020-04-08 23:05 清水仙 阅读(190) 评论(0) 推荐(0) 编辑