随笔分类 -  acwing周赛

目标全ac
摘要:acwing52周赛题目链接 1.智力测试 算法(暴力枚举) \(O(n)\) 枚举即可,直到大于所给值就退出,并且减一即为答案。 C++ 代码 #include<iostream> #include<vector> #include<queue> #include<stack> #include<algorithm> 阅读全文
posted @ 2022-05-21 23:58 knowei 阅读(23) 评论(0) 推荐(0)
摘要:题目链接 1.上车 算法(暴力枚举) \(O(n)\) 只需要判断出车辆空余是否大于二即可 时间复杂度 暴力一遍即可,复杂度位$O(n)$ C++ 代码 #include<iostream> #include<algorithm> #include<cstring> using namespace 阅读全文
posted @ 2022-05-15 15:25 knowei 阅读(37) 评论(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 阅读(41) 评论(0) 推荐(0)