摘要: https://www.luogu.com.cn/problem/P1145涉及知识点:暴力,枚举,搜索 橙色题 代码: #include <stdio.h> int main() { int k,i; while (scanf("%d",&k)!=EOF)//个人输入习惯,请忽略 { int fl 阅读全文
posted @ 2022-07-21 17:19 -イレイナ 阅读(56) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/solution/P5194涉及知识点:搜索,前缀和黄色题 思路: 首先,既然是求最大,那么就应该从后往前搜索,能够避免很多不必要的递归;然后,弄一个一个前缀和数组,显然,当cur+b[index]即当前加上位置i的前缀和如果小于ma 阅读全文
posted @ 2022-07-21 16:05 -イレイナ 阅读(41) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1141涉及知识点:BFS,DFS,队列橙色题 代码: #include<bits/stdc++.h> using namespace std; char _map[1001][1001];//_map数组保存地图 int flag 阅读全文
posted @ 2022-07-21 10:49 -イレイナ 阅读(82) 评论(0) 推荐(0)