自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

蜡笔小新冲鸭!!!

萌新一枚,欢迎讨论和指正错误!!!

  • 博客(288)
  • 收藏
  • 关注

原创 剑指 Offer 35. 复杂链表的复制

【代码】剑指 Offer 35. 复杂链表的复制。

2023-02-27 15:22:43 105 1

原创 剑指 Offer 47. 礼物的最大价值

【代码】剑指 Offer 47. 礼物的最大价值。

2023-02-27 11:12:54 98

原创 剑指 Offer 63. 股票的最大利润

题目链接:https://leetcode.cn/problems/gu-piao-de-zui-da-li-run-lcof/description/?

2023-02-27 10:07:45 101

原创 剑指 Offer 31. 栈的压入、弹出序列

【代码】剑指 Offer 31. 栈的压入、弹出序列。

2023-02-26 19:55:12 58

原创 剑指 Offer 16. 数值的整数次方

题目链接:https://leetcode.cn/problems/shu-zhi-de-zheng-shu-ci-fang-lcof/description/?

2023-02-26 18:05:05 47

原创 剑指 Offer 26. 树的子结构

【代码】剑指 Offer 26. 树的子结构。

2023-02-26 18:04:11 57

原创 剑指 Offer 26. 树的子结构

【代码】剑指 Offer 26. 树的子结构。

2023-02-26 17:41:51 37

原创 剑指 Offer 26. 树的子结构

【代码】剑指 Offer 26. 树的子结构。

2023-02-26 15:45:52 36

原创 剑指 Offer 14- I. 剪绳子

【代码】剑指 Offer 14- I. 剪绳子。

2023-02-26 12:39:27 39

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

题目链接:https://leetcode.cn/problems/er-cha-shu-de-zui-jin-gong-gong-zu-xian-lcof/description/?

2023-02-25 09:57:24 35

原创 剑指 Offer 65. 不用加减乘除做加法

【代码】剑指 Offer 65. 不用加减乘除做加法。

2023-02-24 21:12:08 46

原创 剑指 Offer 57 - II. 和为s的连续正数序列

【代码】剑指 Offer 57 - II. 和为s的连续正数序列。

2023-02-24 21:10:11 41

原创 剑指 Offer 57 - II. 和为s的连续正数序列

【代码】剑指 Offer 57 - II. 和为s的连续正数序列。

2023-02-24 20:03:45 47

原创 剑指 Offer 32 - II. 从上到下打印二叉树 II

【代码】剑指 Offer 32 - II. 从上到下打印二叉树 II。

2023-02-24 19:18:31 43

原创 剑指 Offer 42. 连续子数组的最大和

题目链接:https://leetcode.cn/problems/lian-xu-zi-shu-zu-de-zui-da-he-lcof/description/?

2023-02-24 18:37:44 37

原创 剑指 Offer 30. 包含min函数的栈

【代码】剑指 Offer 30. 包含min函数的栈。

2023-02-24 18:06:27 36

原创 剑指 Offer 29. 顺时针打印矩阵

题目链接:https://leetcode.cn/problems/shun-shi-zhen-da-yin-ju-zhen-lcof/description/?

2023-02-24 17:47:18 39

原创 剑指 Offer 28. 对称的二叉树

题目链接:https://leetcode.cn/problems/dui-cheng-de-er-cha-shu-lcof/?

2023-02-24 16:43:38 38

原创 剑指 Offer 27. 二叉树的镜像

【代码】剑指 Offer 27. 二叉树的镜像。

2023-02-07 02:34:45 57

原创 剑指 Offer 24. 反转链表

题目链接:https://leetcode.cn/problems/fan-zhuan-lian-biao-lcof/description/?

2023-02-07 01:38:19 59

原创 剑指 Offer 10- I. 斐波那契数列

链接:https://leetcode.cn/problems/fei-bo-na-qi-shu-lie-lcof/description/?

2023-02-04 02:29:38 36

原创 剑指 Offer 09. 用两个栈实现队列

剑指offer

2023-02-04 02:12:25 61

原创 n的分划数

int f(int i, int j) //p240.5{ if(i==1 || j==1) return 1; if(i<j) return f(i, i); if(i==j) return f(i, i-1) + 1; return f(i, j-1) + f(i-j, j);}int main (){ int T, n; scanf("%d", &T); while(T--) { scan

2021-12-02 10:22:08 125

原创 一个正整数有可能可以被表示为n个连续正整数之和

一个正整数有可能可以被表示为n(n>=2)个连续正整数之和,如:15=1+2+3+4+515=4+5+615=7+8请编写程序,根据输入的任何一个正整数,找出符合这种要求的所有连续正整数序列。输入格式:输入一个正整数n(1≤n≤1000)输出格式:输出符合题目描述的全部正整数序列,每行一个序列,每个序列都从该序列的最小正整数开始、以从小到大的顺序打印。如果结果有多个序列,按各序列的最小正整数的大小从小到大打印各序列。此外,序列不允许重复,序列内的整数用一个空格分隔,每个序列最后一个整数

2021-12-02 10:18:41 2166 2

原创 设有A,B,C,D,E五人从事J1,J2,J3,J4,J5五项工作,每人只能从事一项,找到效益最高的的一种组合输出

int MansToJobs[6][6]={ {0,0,0,0,0,0}, ///p241.11 {0,13,11,10,4,7}, {0,13,10,10,8,5}, {0,5,9,7,7,4}, {0,15,12,10,11,5}, {0,10,11,8,8,4} }; //前面代表.

2021-12-02 10:16:46 811

原创 旅行售货员问题

const int INF = 10000000; ///p240.6int n, cc = 0, bestc = INF;int **g;int *x, *bestx;void travel(int t) { if (t == n) { if (g[x[t - 1]][x[t]] != INF && g[x[t]][1] != INF && (cc + g[x[t - 1]][x[t]] + g[x[t]][1] < bestc || bes.

2021-12-02 10:15:08 630

原创 文件读写操作

#include<stdio.h>#include<string.h>#include<math.h>#include<algorithm>#define ll long longint main(){ char file_name[200]="C:\\Users\\165226\\Desktop\\cs.txt"; FILE * fp=fopen (file_name, "w") ; //打开文件 int c; //c:接收fgetc

2021-12-02 09:37:49 510

原创 语法分析器设计与实现

#include<bits/stdc++.h>using namespace std;map<char,int>getnum;char getchar_[100];vector<string>proce;int table[100][100];int num=0;int numvt=0;string first[100];string follow[200];void readin(){ memset(table,-1,sizeof(t..

2021-12-02 09:36:20 343

原创 Centos7 更换yum源

yum install wget备份原来的源sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bk下载阿里源cd /etc/yum.repos.dsudo wget -nc http://mirrors.aliyun.com/repo/Centos-7.repo更改阿里yum源为默认源sudo mv Centos-7.repo CentOS-Base.repo更新本地yum缓存# 全

2021-11-07 20:41:03 356

原创 CentOS7 执行yum 命令出错 One of the configured repositories 如何解决

新安装的一台云服务器, 执行yum命令出现了错误, One of the configured repositories failed (Unknown), 最后是Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again 。完整的错误信息是:这里重点是最后一行 for repository: epel/x86_64. 说明是这个仓储出了问题。解决办法1 删除这个仓库rm -f

2021-11-07 19:29:26 10261 1

原创 1047 Student List for Course (25 分)

#include<bits/stdc++.h>using namespace std;#define ll long longconst int maxn=40010;vector<int>v[maxn];char mp[maxn][10];bool cmp(int a,int b){ return strcmp(mp[a],mp[b])<0;}int main(){ int n,k; scanf("%d%d",&n,&a.

2021-10-28 22:56:37 56

原创 1039 Course List for Student (25 分)

#include<bits/stdc++.h>using namespace std;#define ll long longconst int N=40010;const int M=26*26*26*10+11;vector<int>selectcource[M];int getid(char name[]){ int id=0; for(int i=0; i<3; i++) { id=id*26+(name[i].

2021-10-27 23:56:43 67

原创 1024 Palindromic Number (25 分)

#include<bits/stdc++.h>using namespace std;#define ll long longstruct bign{ int d[1000]; int len; bign() { memset(d,0,sizeof(d)); len=0; }};bign change(char str[]){ bign a; int len=strlen(str); .

2021-10-27 23:06:39 73

原创 1023 Have Fun with Numbers (20 分)

#include<bits/stdc++.h>using namespace std;#define ll long longint vis[100];struct bign{ int d[1000]; int len; bign() { memset(d,0,sizeof(d)); len=0; }};bign change(char str[]){ bign a; a.len=s.

2021-10-27 22:35:15 50

原创 1096 Consecutive Factors (20 分)

#include<bits/stdc++.h>using namespace std;#define ll long longconst int maxn=1e5+100;int main(){ ll n; scanf("%lld",&n); ll ansi=0; ll anslen=0; for(ll i=2;i*i<=n;i++) { ll temp=1,j=i; while(1).

2021-10-24 23:52:56 43

原创 1078 Hashing (25 分)

#include<bits/stdc++.h>using namespace std;#define ll long longconst int maxn=1e4+100;int prime[maxn];bool p[maxn]= {0};void find_prime(){ p[1]=1; int cnt=0; for(int i=2; i<maxn; i++) { if(p[i]==false) {.

2021-10-23 00:00:55 48

原创 1015 Reversible Primes (20 分)

#include<bits/stdc++.h>using namespace std;#define ll long longconst int maxn=1e5+100;int prime[maxn];bool p[maxn]= {0};void find_prime(){// p[1]=1; int cnt=0; for(int i=2; i<maxn; i++) { if(p[i]==false) {.

2021-10-22 23:13:05 50

原创 1088 Rational Arithmetic (20 分)

#include<bits/stdc++.h>using namespace std;#define ll long longstruct fraction{ ll up,down;};ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b);}fraction reduction(fraction result){ if(result.down<0) { .

2021-10-21 23:55:14 58

原创 1081 Rational Sum (20 分)

#include<bits/stdc++.h>using namespace std;#define ll long longll gcd(ll a,ll b){ if(b==0) return a; return gcd(b,a%b);}struct fraction{ ll up,down;};fraction reduction(fraction result){ if(result.down<0) { .

2021-10-21 23:14:38 45

原创 1049 Counting Ones (30 分)

#include<bits/stdc++.h>using namespace std;int main(){ int n,a=1,ans=0; int left,now,right; scanf("%d",&n); while(n/a!=0) { left=n/(a*10); now=n/a %10; right=n%a; if(now==0) ans+=left*a; .

2021-10-21 22:30:00 46

空空如也

空空如也

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

TA关注的人

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