wrdoct
wrdoct
全部文章
复习
面经(1)
题解(88)
归档
标签
去牛客网
登录
/
注册
wrdoct的博客
全部文章
/ 复习
(共44篇)
题解 | #计算字符串的编辑距离#
#include <bits/stdc++.h> using namespace std; //动态规划 int minDistance(string s1, string s2){ //本质不同的操作实际上只有三种: //在单词 A 中插入一个字符; //在单词 B 中插入一个字符...
C++
2022-06-22
0
303
题解 | #从单向链表中删除指定值的节点#
#include <bits/stdc++.h> using namespace std; struct ListNode{ int val; ListNode* next; ListNode() : val(0), next(nullptr){}; ...
C++
2022-06-22
0
218
题解 | #名字的漂亮度#
#include <bits/stdc++.h> using namespace std; struct cmp{ bool operator()(const pair<int, int>& a, const pair<int, int>&am...
C++
2022-06-22
0
336
题解 | #Sudoku#
#include <bits/stdc++.h> /* 从左上角开始去遍历这个数独。 对于没有填入的格子(即格子数值为0),我们去枚举1~9每个数字填入, 然后根据数独的性质(同行、同列、同一个九宫格不能有相同数字)去判断填入。 如果可以成功填完所有格子那么就是找到了答案。 找到答案...
C++
2022-06-21
0
287
题解 | #学英语#
#include <bits/stdc++.h> using namespace std; vector<string> ones = { "zero", "one", "two", "three", "four", "five", "six", "seven", "ei...
C++
2022-06-16
0
243
题解 | #迷宫问题#
#include <bits/stdc++.h> using namespace std; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; vector<pair<int, int>> res; v...
C++
2022-06-15
0
250
题解 | #称砝码#
#include <bits/stdc++.h> using namespace std; int main(){ int typeNum = 0; cin >> typeNum; vector<int> weight(typeNum,...
C++
2022-06-15
0
364
题解 | #判断两个IP是否属于同一子网#
#include <bits/stdc++.h> using namespace std; string str2bin(int num){ if(num == 0) return "00000000"; //cout << "num = " &...
C++
2022-06-14
0
339
题解 | #整数与IP地址间的转换#
#include <bits/stdc++.h> using namespace std; void process(string strIP, long decIP, long& _decIP, string& _strIP){ stringstream i...
C++
2022-06-11
0
464
题解 | #兑换零钱(一)#
class Solution { public: /** * 最少货币数 * @param arr int整型vector the array * @param aim int整型 the target * @return int整型 */ ...
C++
2022-06-11
0
279
首页
上一页
1
2
3
4
5
下一页
末页