• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






Baudelaire

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

2021年4月1日

P1123 取数游戏(回溯,暴力枚举
摘要: //开始对回溯有了点概念,//即消除这点被取过造成的状态改变,使每次搜索都用的是最初的状态#include <iostream> #include <set> #include <vector> #include <cmath> #include <cstdio> #include <cstring 阅读全文
posted @ 2021-04-01 18:03 Baudelaire 阅读(116) 评论(0) 推荐(0)
 
P1706 全排列问题 回溯DFS
摘要: //全排列的回溯,我还没看懂,如何实现的回溯 //一直以为排列的时候,数据会互相干扰,发现都是一次性 一条龙找完,然后直接输出,不存在中途又跑另外一个dfs的鬼畜情况 #include <iostream> #include <set> #include <vector> #include <cma 阅读全文
posted @ 2021-04-01 13:50 Baudelaire 阅读(42) 评论(0) 推荐(0)
 
求先序排列(简单
摘要: #include <iostream> #include <set> #include <vector> #include <cmath> #include <cstdio> #include <cstring> #include <algorithm> #define ll long long u 阅读全文
posted @ 2021-04-01 11:08 Baudelaire 阅读(75) 评论(0) 推荐(0)
 
P1460 [USACO2.1]健康的荷斯坦奶牛 Healthy Holsteins(好题啊,终于开始用到了回溯,而且懂得了如何存数据
摘要: #include <iostream> #include <set> #include <vector> #include <cmath> #include <cstdio> #include <cstring> #include <algorithm> #define ll long long u 阅读全文
posted @ 2021-04-01 10:55 Baudelaire 阅读(113) 评论(0) 推荐(0)
 
P1162 填涂颜色(DFS 解题方式新颖
摘要: 题目链接https://www.luogu.com.cn/problem/P1162//一开始想找如何判断0在1的封闭曲线内,后来发现只要找在1之外的就可以//而在1之外的点,一般都可以通过不断扩展最后与边缘相接//所以只要dfs四个边上为0的点,不断往里找0,并把其的vis赋值为1//最后vis既 阅读全文
posted @ 2021-04-01 09:37 Baudelaire 阅读(43) 评论(0) 推荐(0)