KQYaili
KQYaili
全部文章
分类
归档
标签
去牛客网
登录
/
注册
KQYaili的博客
全部文章
(共7篇)
题解 | #kotori和素因子#
挺有意思的一道题 #include<bits/stdc++.h> using namespace std; int a[1000],cnt,ans=0x3f3f3f3f; vector<int> s[1100]; map<int,bool> mp; bool is...
C++
深度优先搜索
2022-11-02
0
328
题解 | #N皇后问题#
做题做累了,放松下心情 class Solution { public: /** * * @param n int整型 the n * @return int整型 */ int ans=0; bool col[25],dg[25...
C++
深度优先搜索
2022-11-02
0
284
题解 | #【模板】堆#
菜狗只会这么写 #include<bits/stdc++.h> using namespace std; int main() { priority_queue<int, ...
C++
堆(优先队列)
2022-11-01
5
349
题解 | #最小生成树#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 &...
C++
2022-10-30
0
302
题解 | #实现二叉树先序,中序和后序遍历#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ class Solution { public: /** * ...
C++
2022-10-29
0
290
题解 | #【模板】拓扑排序#
最后一个不能有空格就离谱 #include<bits/stdc++.h> using namespace std; const int N=2e5+10; int e[N],ne[N],h[N],n,m,idx,top[N],d[N],cnt; void add(int a,int b)...
C++
2022-10-29
0
264
题解 | #删除链表的节点#
不想考虑空间开销。。。。。 /** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class So...
C++
2022-10-29
0
275