自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(46)
  • 收藏
  • 关注

原创 win10更新wsl.exe闪退,wsl命令行打不开

在“控制面板”->“程序和功能”->“打开或关闭 Windows 功能”-> 选中“适用于 Linux 的 Windows 子系统”,或使用 PowerShell 命令来启用它。

2024-06-14 20:38:04 308

原创 error LNK2001: 无法解析的外部符号 __imp_curl_easy_perform

添加 libcurl.lib,路径+文件名。

2024-05-16 17:14:23 434

原创 .obj : error LNK2019: 无法解析的外部符号

添加了对应的库的路径和lib文件。

2024-05-16 16:12:23 417

原创 visual studio inlcude ““ <>区别

指令的文件相同的目录中开始。如果找不到该文件,它会在当前打开的包含文件的目录中搜索下一个,按照打开它们的相反顺序。搜索从父包含文件的目录中开始进行,然后继续向上到任何祖父包含文件的目录。指令以尖括号形式指定,或者本地目录搜索失败,它会按照在命令行中指定的顺序搜索使用 /I。指令,则首先搜索本地目录。搜索从与包含 #include。如果使用双引号形式指定 #include。环境变量中指定的目录。如果 #include。

2024-05-15 18:28:21 152

原创 vscode 找不到头文件 No such file or directory

1.添加项目根目录下./vscode/c_cpp_properties.json中的includepath。2.在项目根目录下./vscode/tasks.json中,"args"参数添加-l参数,

2024-05-14 00:26:59 1298

原创 rtx3090,GPUcuda版本和pytorch、cudatoolkit版本问题

需要升级cudatoolkit版本到11.1及以上,相应的pytorch要用1.8.0及以上的。(python版本要3.6以上的,用的3.7的)检查GPU的cuda版本是否匹配:nvidia-smi。

2023-07-24 05:43:56 690

原创 代理配置问题

WLAN运行网页打不开参考文档:Windows 计算机如何设置代理服务器 | 华为官网

2023-03-28 17:51:22 85

原创 git 报错及解决

1. Failed to connect to 127.0.0.1 port 7890 after 2095 ms: Connection refused代理问题解决方法://取消http代理git config --global --unset http.proxy//取消https代理 git config --global --unset https.proxy2.10054报错OpenSSL SSL_read: Connection was reset, errno 1

2022-05-06 01:34:19 1494 1

原创 anaconda+pytorch+vscode下的安装问题

pytorch安装已经成功,可以看版本号,cmd下可以运行,jupyter也可,vscode下报错:ModuleNotFoundError:Nomodulenamed'torch'试了很多方法,不是版本的问题,也不是环境变量的问题解决方法:在vscode中修改setting.json参考文章:关于VS code中 import后却显示no module的问题解决(明明安装了却无法导入,终端可以运行,输出端不行) - it610.com1.注释//"python.pythonPath"...

2021-09-16 21:31:47 228

原创 剑指 Offer 68 - II. 二叉树的最近公共祖先

题目链接:https://leetcode-cn.com/problems/er-cha-shu-de-zui-jin-gong-gong-zu-xian-lcof难度简单212给定一个二叉树, 找到该树中两个指定节点的最近公共祖先。百度百科中最近公共祖先的定义为:“对于有根树 T 的两个结点 p、q,最近公共祖先表示为一个结点 x,满足 x 是 p、q 的祖先且 x 的深度尽可能大(一个节点也可以是它自己的祖先)。”例如,给定如下二叉树: root = [3,5,1,6,2,0,8,null.

2021-03-16 18:19:51 57

原创 PAT (Advanced Level) Practice-1020 Tree Traversals

Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the corresponding binary tree.Input Specification:Each inpu

2021-03-16 10:38:18 76

转载 c++优先队列(priority_queue)用法详解【转载】

既然是队列那么先要包含头文件#include <queue>, 他和queue不同的就在于我们可以自定义其中数据的优先级, 让优先级高的排在队列前面,优先出队优先队列具有队列的所有特性,包括基本操作,只是在这基础上添加了内部的一个排序,它本质是一个堆实现的和队列基本操作相同:top 访问队头元素 empty 队列是否为空 size 返回队列内元素个数 push 插入元素到队尾 (并排序) emplace 原地构造一个元素并插入队列 pop 弹出队头元素 swap 交换内

2021-03-12 12:36:09 84

原创 日期之间隔几天

请你编写一个程序来计算两个日期之间隔了多少天。日期以字符串形式给出,格式为 YYYY-MM-DD,如示例所示。示例 1:输入:date1 = "2019-06-29", date2 = "2019-06-30"输出:1示例 2:输入:date1 = "2020-01-15", date2 = "2019-12-31"输出:15提示: 给定的日期是 1971 年到 2100 年之间的有效日期。来源:力扣(LeetCode)链接:https://le...

2021-03-11 22:50:35 174

原创 求解方程-一元一次加减法

求解一个给定的方程,将x以字符串"x=#value"的形式返回。该方程仅包含'+',' - '操作,变量 x 和其对应系数。如果方程没有解,请返回“No solution”。如果方程有无限解,则返回“Infinite solutions”。如果方程中只有一个解,要保证返回值 x 是一个整数。示例 1:输入: "x+5-3+x=6+x-2"输出: "x=2"示例 2:输入: "x=x"输出: "Infinite solutions"示例 3:输入: "2x=x"输

2021-03-11 21:30:03 388 2

原创 【2016-1】求最大公共字串长度

【2016-1】求最大公共字串长度题目描述:给定两个字符串,求最大公共字串的长度,长度小于1000分为两种问题:要求计算连续最长字串的长度如下按照寻找连续的字串理解输入:1111hello22221133hello444输出:5#include <iostream>#include <string>#include <math.h>using namespace std;#define maxn 1005int dp[maxn][maxn]

2021-03-10 21:10:39 298

原创 神奇的口袋-一维dp

#include <iostream>#include <cstring>using namespace std;int main(){ int n=0, arr[25], dp[50]; cin >> n; memset(dp, 0, sizeof(dp)); dp[0]=1; for(int i=1; i<=n; ++i){ cin >> arr[i]; } for(i.

2021-03-09 10:59:09 58

原创 神奇的口袋-二维dp

#include <iostream>#include <cstring>using namespace std;int main(){ int n=0, arr[25], dp[30][50]; cin >> n; memset(dp, 0, sizeof(dp)); for(int i=0; i<=n; ++i) //本题,任何物品,v=0时,都有一种选择情况成立 dp[i][0]=1; f.

2021-03-08 23:17:28 56

原创 神奇的口袋-dfs

题目描述有一个神奇的口袋,总的容积是40,用这个口袋可以变出一些物品,这些物品的总体积必须是40。John现在有n个想要得到的物品,每个物品的体积分别是a1,a2……an。John可以从这些物品中选择一些,如果选出的物体的总体积是40,那么利用这个神奇的口袋,John就可以得到这些物品。现在的问题是,John有多少种不同的选择物品的方式。输入描述:输入的第一行是正整数n (1 <= n <= 20),表示不同的物品的数目。接下来的n行,每行有一个1到40之间的正整数,分别给出a1,

2021-03-08 22:41:17 84

原创 背包问题-分组背包

每一组内只取一种物品,或者一件也不取,归于01背包#include <iostream>#include <algorithm>#include <cstring>#include <math.h>using namespace std;const int maxn=105;int main(){ int N=0, V=0; int v[maxn][maxn], w[maxn][maxn], dp[maxn], s[maxn]; c

2021-03-08 21:22:53 46

原创 背包问题-多重背包-进制优化

模板题解#include <iostream>#include <algorithm>#include <cstring>#include <math.h>using namespace std; const int maxn=1005, maxv=12000; //maxv不够大的时候,结果dp[V]会溢出//ceil(log(2005.0)/log(2.0));向上取整为11 int main(){ int

2021-03-08 20:58:44 54

原创 背包问题-多重背包-朴素解法

模板题解#include <iostream>#include <algorithm>#include <cstring>#include <math.h>using namespace std;const int maxn=105;int main(){ int N=0, V=0, v[maxn], w[maxn], s[maxn]; int dp[maxn][maxn]; cin >> N >> V;

2021-03-08 20:56:33 101

原创 背包问题-完全背包-进一步化简

模板题解化简方式类似于01背包化简方式#include <iostream>#include <algorithm>#include <cstring>#include <math.h>using namespace std;int main(){ int N=0, V=0, v[1005], w[1005]; int dp[1005]; cin >> N >> V; memset(dp, 0,sizeof

2021-03-08 20:54:21 55

原创 背包问题-完全背包-初步化简

模板题解#include <iostream>#include <algorithm>#include <cstring>#include <math.h>using namespace std;int main(){ int N=0, V=0, v[1005], w[1005]; int dp[1005][1005]; cin >> N >> V; for(int i=1; i<=N; ++i){

2021-03-08 20:52:40 56

原创 背包问题-完全背包-朴素解法

模板题解最基本的三层循环,二维dp数组的做法#include <iostream>#include <algorithm>#include <cstring>#include <math.h>using namespace std;int main(){ int N=0, V=0, v[1005], w[1005]; int dp[1005][1005]; while(cin >> N >> V){ me

2021-03-08 20:38:50 102

原创 背包问题-01背包-化简版

模板题解一维dp数组#include <iostream>#include <algorithm>#include <cstring>#include <string>#include <math.h>#include <vector>using namespace std;int main(){ int N=0, V=0, v[1005], w[1005]; int dp[1005]; while(ci

2021-03-08 20:36:04 81

原创 背包问题-01背包-朴素解法

模板题解#include <iostream>#include <algorithm>#include <cstring>#include <string>#include <math.h>#include <vector>using namespace std;int main(){ int N=0, V=0, v[1005], w[1005]; int dp[1005][1005]; while(c...

2021-03-08 20:34:14 68

原创 hdu-2084数塔dfs

#include <iostream>#include <algorithm>#include <cstring>#include <string>#include <math.h>#include <vector>using namespace std;int n;int dfs(int x, int y, int (*arr)[105], int (*ans)[105]){ //传二维数组指针为形参,必须指定一.

2021-03-07 15:16:36 70

原创 hdu-2084数塔dp

#include <iostream>#include <algorithm>#include <cstring>#include <string>#include <math.h>#include <vector>using namespace std;int main(){ int t=0, n=0; cin >> t; int arr[105][105]; //存数据 int d.

2021-03-07 15:14:04 57

原创 hdu-1846巴什博弈

#include <iostream>#include <algorithm>#include <cstring>#include <string>#include <math.h>#include <vector>using namespace std;//最先取完石子,巴什博弈int main(){ int t=0; cin >> t; int n=0, m=0; while(t--){.

2021-03-07 15:12:32 88

原创 codeForces-1A

#include <iostream>#include <algorithm>#include <cstring>#include <string>#include <math.h>#include <vector>using namespace std;int main(){ long long n=0, m=0, a=0; while(cin >> n >> m>> a.

2021-03-07 15:11:02 73

原创 hdu-2503分数求和

#include <iostream>#include <algorithm>#include <cstring>#include <string>#include <math.h>#include <vector>using namespace std;int gcd(int x, int y){ //辗转相除,欧几里得求最大公约数 if(y>x){ swap(x, y);.

2021-03-07 15:09:04 79

原创 hdu-1262欧拉筛法

#include <iostream>#include <algorithm>#include <cstring>#include <string>#include <math.h>#include <vector>using namespace std;int main(){ int n=0; bool arr[10005]; vector<int> prime;.

2021-03-07 15:07:35 75

原创 hdu-1262找素数对

#include <iostream>#include <algorithm>#include <cstring>#include <string>#include <math.h>using namespace std;int main(){ int n=0,; bool arr[10005]; memset(arr, false, sizeof(arr)); for(int i=2.

2021-03-07 15:05:30 53

原创 hdu-1257

导弹拦截系统#include <iostream>#include <cstring>#include <vector>#include <algorithm>using namespace std;int find(int n, int dp[], int arr[]){ dp[0]=1; int ans=1; for(int i=1; i<n; ++i){ int mx=1; //以i为结尾的最长增字串长度为mx

2021-03-07 15:03:52 31

原创 hud-1159

最长公共子序列#include <iostream>#include <algorithm>#include <cstring>#include <string>#include <math.h>using namespace std;int dp[1000][1000]; int DP(string s1, string s2){ memset(dp, 0, si

2021-03-07 15:01:42 60

原创 hdu-2602

骨头收集者#include <iostream>#include <algorithm>#include <cstring>using namespace std;struct Bone{ int val, vol;}bone[1005];int dp[1005][1005];int ans(int n, int v){ memset(dp, 0, sizeof(dp)); for(int i=1; i<=n; ++

2021-03-07 14:59:15 58

原创 dhu-2544弗洛伊德

邻接矩阵+弗洛伊德#include <iostream>#include <cstring>#include <vector>using namespace std;#define INF 0x3f3f3f3fstruct node{ int next; int lenth; node(int next=-1, int lenth=-1):next(next), lenth(lenth){}};vector<vector<node

2021-03-06 18:22:03 85

原创 hdu-2544

邻接表+迪杰斯特拉#include <iostream>#include <cstring>#include <vector>using namespace std;#define INF 10005int mp[105][105]; void floyd(int n){ for(int i=1; i<=n; ++i){ //经过i点 for(int j=1; j<=n; ++j){ //从j出发 if(m

2021-03-06 18:20:54 64

原创 hdu-2544

最短路Time Limit: 5000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 124743Accepted Submission(s): 53973Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找...

2021-03-06 18:18:53 50

原创 dhu-1312bfs版

队列版ac代码:#include <iostream>#include <stdio.h>#include <vector>#include <algorithm>#include <iomanip>#include <string>#include <queue>using namespace std;char chart[22][22];int dis[4][2]={0, 1, 0, -1, 1

2021-03-06 18:10:57 82

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除