![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
寒假的小尾巴
WACMer
渣渣
展开
-
Find The Multiple POJ - 1426 bfs || 同余 || dfs
第一次bfs,比着葫芦画瓢,首先是第一种,使用率比较高的一种,直接bfs,很好写 #include<iostream> #include<queue> typedef long long lol; using namespace std; void bfs(int n){ lol m; queue<lol> que; que.push(1); whil...原创 2020-03-10 23:51:23 · 109 阅读 · 0 评论 -
POJ3278抓牛 bfs:队列+struct
BFS以及3.10的小目标原创 2020-03-10 15:56:49 · 91 阅读 · 0 评论 -
zzuli0305训练赛 # 1268 和为K的组合 # dfs & dp
训练地址 巴啦啦能量 从mc大佬那里抄来的代码 #include<bits/stdc++.h> using namespace std; int flag,n,k,a[105],s=0; int dfs(int s,int l) { if(k==s) flag=1; if(l==n||flag) return 1; dfs(s+a[l],l+1); dfs(s,l+1); }...原创 2020-03-07 01:31:11 · 79 阅读 · 0 评论 -
zzuli0301训练赛 # cf1059B #
ZZULIACMer 这一题的主要思路就是确定可以下笔的位置,然后把所有可以下笔的位置在第二数组里反映出来,以后与第一数组一一对照即可 注意此类问题搜索时的数组越界的问题 #include<bits/stdc++.h> using namespace std; int dx[8]= {-1,-1,0,1,1,1,0,-1}; int dy[8]= {0,1,1,1,0,-1,-1,-1...原创 2020-03-03 18:51:55 · 128 阅读 · 0 评论 -
D - 最少拦截系统的贪心解法(博客初体验)
最长上升序列LIS系列(dp) //第一套最低160,第二套最低120,第三套开始为150,所以此问题利用贪心解法需要数组记忆每套系统剩余的价值 #include<iostream> #include<algorithm> #include<cstring> using namespace std; int main() { int m,n,i,t,a...原创 2020-02-14 22:31:23 · 140 阅读 · 0 评论