摘要: 题目链接 1.上车 算法(暴力枚举) \(O(n)\) 只需要判断出车辆空余是否大于二即可 时间复杂度 暴力一遍即可,复杂度位$O(n)$ C++ 代码 #include<iostream> #include<algorithm> #include<cstring> using namespace 阅读全文
posted @ 2022-05-15 15:25 knowei 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 题目链接 1.缺少的数 模拟 \(O(n)\) 可以使用桶排序,将未出现的字母输出即可 时间复杂度 遍历一次O(n) C++代码 #include <iostream> #include <cstring> #include <algorithm> using namespace std; cons 阅读全文
posted @ 2022-05-15 15:24 knowei 阅读(29) 评论(0) 推荐(0) 编辑