蓝桥杯2023年第十四届省赛真题-飞机降落 摘要:#include <bits/stdc++.h> using namespace std; // 该题,因为数据范围很小,所以可以 把所有的排列情况列出来 // 然后 每列出 一个飞机,…… 题解列表 2024年03月17日 3 点赞 4 评论 2124 浏览 评分:10.0
蓝桥杯2023年第十四届省赛真题-飞机降落(暴力枚举) 基于全排列函数next_permutation 摘要:解题思路:注意事项:有题目数据范围飞机数量 n<=10,可知本问题可对所有飞机的下落顺序进行全排(最大循环次数10!*10约为3e7,可过所有样例),得到得所以方案中有一种满足即为YES。即当得到一种…… 题解列表 2024年02月23日 0 点赞 2 评论 1275 浏览 评分:9.3
暴力搜索 dfs 摘要:解题思路:用1~9的排列的方法 ,在排列时进行判断是否可以 注意事项:参考代码:#include<bits/stdc++.h> using namespace std; class plane{ …… 题解列表 2023年11月29日 0 点赞 2 评论 2964 浏览 评分:9.1
谁都能看懂的DFS 摘要:解题思路:N < 10 且时间限定为2s 故采用DFS(深度优先搜索)将所有可能排列枚举 并对每种排列进行处理检查是否符合要求注意事项:参考代码:#include <bits/stdc++.h> u…… 题解列表 2024年04月05日 0 点赞 0 评论 508 浏览 评分:9.0
DFS(深度优先遍历) 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h> #include<vector> using namespace std; int flag=0; class…… 题解列表 2024年03月07日 0 点赞 0 评论 693 浏览 评分:9.0
蓝桥杯2023年第十四届省赛真题-飞机降落(dfs) 摘要:#include <bits/stdc++.h> using namespace std; const int N = 20; int vis[N]; int flag = 0; in…… 题解列表 2024年04月10日 0 点赞 0 评论 749 浏览 评分:8.7
数学思想讨论问题,dfs(当前选择哪个火箭发射,上一个火箭降落完毕时间,这是第几个发射的火箭),分三种情况,思路可以很清晰,时间复杂度o(n2n!)10的8次方,应该是完全可以的,不过还可以优化,毕竟 摘要:思路就是标题,代码上传格式比较奇怪,随便看看参考代码:#include <bits/stdc++.h>using namespace std;const int N=20;int T,n,ans;in…… 题解列表 2024年01月24日 0 点赞 0 评论 664 浏览 评分:8.7
蓝桥杯2023年第十四届省赛真题-飞机降落 暴力全排列 摘要:解题思路:因为数据量少,所以可以列出所有情况,若有符合题意的情况就输出YES,否则输出NO,可以使用C++的next_permutation函数,搭配sort函数使用即可进行全排列注意事项:参考代码:…… 题解列表 2024年01月28日 0 点赞 0 评论 750 浏览 评分:8.7
飞机降落蓝桥杯 摘要:解题思路:// 错误点 // vis是否需要清0,不需要,最后回溯,完成清0// come use dw 关系// 主要到time取max(time,come[i]) ;; //如果time < co…… 题解列表 2023年05月03日 0 点赞 0 评论 1806 浏览 评分:8.5
飞机降落-详细注释易看懂(暴力枚举) 摘要:解题思路:n限制小,选择暴力枚举,找到降落顺序,详细注释注意事项:参考代码:#include using namespace std; const int N = 10+20; struct pl…… 题解列表 2024年03月03日 0 点赞 2 评论 1027 浏览 评分:8.5