邱少卿
邱少卿
全部文章
分类
归档
标签
去牛客网
登录
/
注册
邱少卿的博客
全部文章
(共17篇)
题解 | #表示数值的字符串#
直接通过规则判断即可,一层循环,时间复杂度为O(n)。 class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param str string字符串 ...
2023-10-01
0
247
题解 | #正则表达式匹配#
自动机解法,需要保持Pattern的最简性,不然会超时。 #include <string> #include <unordered_map> #include <vector> struct Node{ char ch; bool star; ...
2023-10-01
0
298
题解 | #彩虹涂鸦#
直接模拟即可 #include <iostream> #include <vector> #include<bits/stdc++.h> using namespace std; int main() { int n, q; cin >&g...
2023-09-30
0
296
题解 | #愤怒的小鸟#
单调栈 #include <iostream> #include <bits/stdc++.h> #include <stack> using namespace std; int main() { int n; cin>> n; ...
2023-09-30
0
198
题解 | #信号覆盖#
并查表 #include <bits/stdc++.h> #include <cmath> #include <vector> using namespace std; struct Node{ int u; int v; int dis...
2023-09-30
0
329
题解 | #相遇#
dfs+打表 #include <iostream> #include <bits/stdc++.h> #include <vector> using namespace std; int MOD_NUM = 100007; int dfs(vector<...
2023-09-29
0
232
题解 | #涂颜料#
先将涂色区域按照left升序排序。因为left越小覆盖的范围越左。随后,维护一个小顶堆,根据left判断是否加入这个涂色区域的pair。在小顶堆内,保持right最小的元素始终在顶部。当小顶堆顶部的pair已经不覆盖当前区域时,将其移除。 #include <algorithm> #in...
2023-09-29
0
279
首页
上一页
1
2
下一页
末页