牛客640386894号
牛客640386894号
全部文章
题解
归档
标签
去牛客网
登录
/
注册
牛客640386894号的博客
全部文章
/ 题解
(共9篇)
题解 | #【模板】01背包#
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, v; cin >> n >...
C++
贪心
2022-06-30
0
304
题解 | #最长山脉#
模拟实现 class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param nums int整型vector * @return int整型 ...
C++
2022-06-29
0
538
题解 | #牛客代码自动补全#
模拟实现 class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param dict string字符串vector * @param st...
C++
2022-06-27
1
440
题解 | #某云ES倒排索引#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param ID int整型vector * @param content string...
C++
2022-06-27
0
344
题解 | #走迷宫#
BFS 实现 #include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); vector<vector<int&g...
C++
广度优先搜索
2022-06-27
1
256
题解 | #判断是不是完全二叉树#
BFS 实现 /** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nul...
C++
广度优先搜索
2022-06-24
0
283
题解 | #求平方根#
牛顿迭代法求平方根 class Solution { public: /** * * @param x int整型 * @return int整型 */ int mysqrt(int x) { double t = x; ...
C++
数学
2022-06-23
0
263
题解 | #右侧更小数#
//定义线段树 class segtree{ public: segtree* leftNode = NULL; segtree* rightNode = NULL; int left = 0; int right = 0; ...
C++
线段树
2022-06-23
0
487
题解 | #跳跃游戏(三)#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param nums int整型vector * @return int整型 ...
C++
2022-06-22
0
414