自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(39)
  • 资源 (1)
  • 收藏
  • 关注

原创 黑暗料理-黄瓜变蛋凉菜

先拿工具把黄瓜皮剥了剥好后洗一洗从中间切开,啪,拍一下,再切小块切好再洗洗,水倒出变蛋3-4个,放塑料袋里(因为壳很脏)啪,甩两下把壳摔碎把变蛋剥好放碗里洗洗切一切放黄瓜里整个蒜,大致掰扯开放案板上,啪啪拍两下拍碎后就比较容易剥开,剥开后把皮扔了蒜切碎放入黄瓜里什么盐鸡精味精什么的放啥我忘了甚至想放芝麻酱拌一拌成了...

2021-06-29 20:53:22 128

原创 黑暗料理-花菜+肉丝+木耳

先把木耳拿水泡一下掰扯花菜,根掰掉切一下花菜,然后拿水清洗洗几次忘了,然后烧水拿水煮完了关掉电磁反应装置,加点凉水慢慢把水倒掉(加凉水防止倒热水下取水管炸掉)然后加凉水反复洗接下来木耳泡发了把木耳的根(如果有的话)掰扯掉反复用水搓洗接下来拿出提前准备好的肉丝(别问怎么准备的,问就是不知道)油,热,工具人花椒胡椒,懂?放入花菜,木耳,肉(放的顺序是啥,忘了,也许不重要?)放盐,翻炒生抽,翻炒料酒,翻炒香油,翻炒一点酱油上色,翻炒可能还要放

2021-06-29 20:44:18 512

原创 黑暗料理-炒茄子

先切好茄子加入鸡精味精揉搓放入面粉揉搓锅里加油热油,加入花椒胡椒热好有味道了后,把工具人花椒胡椒撇开把整好的带面皮的茄子倒入炸,每个面都要炸好是不是还要放点啥我忘了,随便点点出锅...

2021-06-29 20:33:54 121

原创 多重背包问题

#include<stdio.h>int max(int a, int b){ return (a > b ? a : b);}struct E{ int W; int price;}list[1001];int dp[1001];int main(){ int s, n; while (scanf("%d%d", &s, &n) !=...

2020-03-05 17:17:30 63

原创 完全背包问题

#include<stdio.h>#include<algorithm>using namespace std;int min(int a, int b){ return (a < b ? a : b);}struct T{ int W; int price;}list[101];int dp[1001];int main(){ int ...

2020-03-05 16:55:30 49

原创 0-1背包问题

#include<stdio.h>#include<algorithm>using namespace std;int max(int a, int b){ return (a > b ? a : b);}struct T{ int V; int price;}list[101];int dp[101][1001];int main(){...

2020-03-05 16:01:54 51

原创 九度OJ(搬宿舍)

#include<stdio.h>#include<algorithm>using namespace std;int thing[2001];int dp[1001][2001];int main(){ int n, k; while (scanf("%d%d", &n, &k) != EOF) { for (int i = 1; i...

2020-03-04 19:20:16 131

原创 最长公共子序列

#include<stdio.h>#include<string>using namespace std;int max(int a, int b){ return a > b ? a : b;}int dp[101][101];char s1[101];char s2[101];int main(){ while (scanf("%s%s",...

2020-03-04 18:53:49 68

原创 最长递增子序列

#include<stdio.h>int max(int a, int b){ return a > b ? a : b;}int list[26];int dp[26];int main(){ int n; while (scanf("%d", &n) != EOF) { for (int i = 1; i <= n; i++) s...

2020-03-04 18:33:11 62

原创 N封信封全部装错(错排公式)

错排公式:F[n]=(n-1)*F[n-1]+(n-2)*F[n-2]#include<stdio.h>long long F[21];int main(){ F[1] = 0; F[2] = 1; for (int i = 3; i <= 20; i++) F[i] = (i - 1)*F[i - 1] + (i - 1)*F[i - 2]; int n;...

2020-03-02 11:49:47 2623

原创 N阶楼梯上楼问题(递推求解)

N阶楼梯上楼问题:一次可以走一阶或者两阶,问有多少种上楼方式。因为只可能从n-1阶和n-2阶走到n阶,因此走到n阶的方式数量=走到n-1阶的方式数量+走到n-2阶的方式的数量。也就是F[n]=F[n-1]+F[n-2],也就是斐波那契数列。#include<stdio.h>long long F[51];int main(){ F[1] = 1; F[2] = 2; ...

2020-03-02 11:21:07 2319 3

原创 深度优先搜索(九度OJ 1461)(temple of the bone)

#include<stdio.h>char maze[100][100];bool mark[100][100];int n, m;int find[][2] ={ 1,0, 0,1, -1,0, 0,-1, 1,-1, -1,1, 1,1, -1,-1};void DFS(int x, int y){ for (int i = 0; i < 8...

2020-02-29 22:31:52 80

原创 递归应用二:Flood Fill算法,将相邻的点联合成一个块

#include<stdio.h>char maze[100][100];bool mark[100][100];int n, m;int find[][2] ={ 1,0, 0,1, -1,0, 0,-1, 1,-1, -1,1, 1,1, -1,-1};void DFS(int x, int y){ for (int i = 0; i < 8...

2020-02-29 21:54:09 146

原创 递归应用一:回溯法枚举解决素数环问题

递归应用一:回溯法枚举解决素数环问题#include<stdio.h>int ans[17];bool mark[17];int prime[11] = { 2,3,5,7,11,13,17,19,23,29,31 };bool judge(int x){ for (int i = 0; i < 11; i++) if (x == prime[i]) re...

2020-02-29 21:32:37 219

原创 胜利大逃亡(九度OJ 1456)(BFS搜索)

#include<stdio.h>#include<queue>using namespace std;bool mark[50][50][50];int maze[50][50][50];int walknext[][3] ={ 1,0,0, -1,0,0, 0,1,0, 0,-1,0, 0,0,1, 0,0,-1};struct point...

2020-02-29 15:32:02 116

原创 利用拓扑排序判断一个图是否为无环图

#include<stdio.h>#include<vector>#include<stack>using namespace std;vector<int> edg[100];stack<int> s;int main(){ int n, m; int rudu[100]; while (scanf("%d%d", ...

2020-02-26 22:25:20 71

原创 叠框-机试题

#include<stdio.h>void pr1(char a, char b, int n){ for (int i = 1; i <= n; i++) { if (i % 2 == 1) printf("%c", b); else printf("%c", a); }}void pr2(char a, int n){ for (int ...

2020-02-26 18:22:49 51

原创 Floyd算法计算最短路径和迪杰斯特拉算法

#include<stdio.h>int ans[101][101];int main(){ int n, m; while (scanf("%d%d", &n, &m) != EOF) { if (m == 0 && n == 0) break; for (int i = 1; i <= n; i++) { f...

2020-02-26 18:17:35 153

原创 kruskal算法最小生成树(机试题Freckles)

#include<stdio.h>#include<algorithm>using namespace std;int tree[100];int findroot(int x){ if (tree[x] == -1) return x; else { int temp = findroot(tree[x]); tree[x] = temp; ...

2020-02-26 14:47:24 142

原创 n个城镇初始m条道路,最少修几条路使所有城镇相通?(集合的应用)

#include<stdio.h>using namespace std;int tree[100];int findroot(int x){ if (tree[x] == -1) return x; else { int temp = findroot(tree[x]); tree[x] = temp; return temp; }}int mai...

2020-02-25 21:32:43 731

原创 较大整数的数制转换

#include<stdio.h>#include<string.h>struct bignum{ int digit[1000]; int size; void init() { size = 0; for (int i = 0; i < 1000; i++) digit[i] = 0; } void set(int x) { ...

2020-02-25 15:54:33 90

原创 计算较大的阶乘(20以内)

#include<stdio.h>#include<string.h>struct bignum{ int digit[1001]; int size; void init() { for (int i = 0; i <= 1000; i++) digit[i] = 0; size = 0; } void set(int x) { ...

2020-02-24 14:57:42 109

原创 大数加法器

#include<stdio.h>#include<string.h>struct bignum{ int digit[1001]; int size; void init() { for (int i = 0; i <= 1000; i++) digit[i] = 0; size = 0; } void tiqu(char str[]...

2020-02-24 12:13:25 90

原创 二分法求幂

题目:求A^B的最后三位数表示的整数#include<stdio.h>int main(){ int a, b; while (scanf("%d%d", &a, &b) != EOF) { int ans = 1; if (a == 0 && b == 0) break; while (b != 0) { if ...

2020-02-24 11:45:47 201

原创 给定n,a求最大的k,使n!(阶乘)可以被a^k整除但不能被a^(k+1)整除

#include<stdio.h>#include<string.h>bool mark[1001];int size1;int prime[1000];void init(){ size1 = 0; for (int i = 0; i <= 1000; i++) mark[i] = false; for (int i = 2; i <= ...

2020-02-24 11:33:42 361

原创 分解素因数

设x=p1^e1 +p2^e2…求x的p1…pn和e1…en#include<stdio.h>int prime[10000];bool mark[10001];int size1;void init(){ for (int i = 0; i <= 10000; i++) mark[i] = false; size1 = 0; for (int i = 2...

2020-02-23 19:11:37 106

原创 数制转换:a进制转换为b进制

#include<stdio.h>#include<string.h>int main(){ long int a, b; char num[100]; while (scanf("%d%s%d", &a, num, &b) != EOF) { int length = strlen(num), c = 1; int temp=0; f...

2020-02-23 14:06:04 1293

原创 关于求余问题

以a%b为例,求得的余数的符号与a的保持一致,因此求模运算符求得的余数有存在负数的可能性。r=a%b有a=k*b+r使r1=(r+b)%b=(r%b+b%b)%b=r%b%b=r%b=r,注意但是此时由于r+b,所以r若为负数,那么最后得到的是正数的余数。若r为正数,则不影响结果。所以一般谨慎地话求余r=(a%b+b)%b...

2020-02-23 10:02:30 183

原创 万能头文件

#include<bits/stdc++.h>

2020-02-23 09:56:14 191

原创 判断两序列是否为同一二叉搜索树

#include<stdio.h>#include<string>using namespace std;struct node{ node *lchild; node *rchild; int c;}tree[100];int loc = 0;char str1[30], str2[30];int size1, size2;char *str;i...

2020-02-21 21:26:50 587

原创 二叉排序树

#include<stdio.h>#include<string>using namespace std;struct node{ node *lchild; node *rchild; int x;}tree[50];int loc = 0;node *creat(){ tree[loc].lchild = tree[loc].rchild = N...

2020-02-20 20:57:37 76

原创 二叉树的遍历,建树,还原

#include<stdio.h>#include<string>using namespace std;struct node{ node *lchild; node *rchild; char c;}tree[50];int loc = 0;node *creat(){ tree[loc].lchild = tree[loc].rchild = ...

2020-02-20 18:47:26 50

原创 求哈夫曼树带权路径长度和

#include<stdio.h>#include<queue>using namespace std;priority_queue<int, vector<int> ,greater<int>> q;int main(){ int n; while (scanf("%d", &n) != EOF) { whi...

2020-02-20 13:38:28 282

原创 关于c中stack的应用

#include< stack >stack< int > s;定义一个保存元素类型为int的堆栈s。s.empty();若返回值为true,则栈空。若为false,则栈非空。s.pop();弹出栈顶元素。s.push(i);向堆栈中压入一个数值为i的元素;s.top();读取栈顶元素,并返回其值。通常int x=s.top();s.size();返...

2020-02-20 13:36:49 351

原创 计算器....

#include<stdio.h>#include<stack>#include<string>#include<iostream>using namespace std;stack<int> s;stack<double> p;char input[100];int mat[5] = { 1,2,2,3,3 ...

2020-02-18 19:40:54 79

原创 二分法查找学生信息

#include<algorithm>#include<iostream>#include<stdio.h>#include<string.h>using namespace std;struct student{ char num[10]; char name[10]; char sex[5]; int ...

2020-02-10 14:27:00 177

原创 统计同成绩学生人数

读入N名学生的成绩,将获得某一特定成绩的学生的人数输出。格式:学生个数NN名学生的成绩,用空格隔开查询的分数成绩为0-100#include<stdio.h>int main(){ int n; while (scanf("%d", &n) != EOF && n != 0) { int buff[101] = { 0 }; for...

2020-02-09 17:08:38 575

原创 求日期差值

日期差值主要是根据当前日期到00年1月1日的差值减去另一个日期到00年1月1日的差值简单方法:#include<bits/stdc++.h>using namespace std;int month[12]={0,31,59,90,120,151,181,212,243,273,304,334};int cal(int y,int m,int d){ return ...

2020-02-09 16:46:29 97

原创 关于c++中排序算法的库函数使用

首先,引用头是 #include< algorithm >,c++is_sortedis_sort 是一个判断数组内元素是否按照所定义的排序方式排列的函数。默认排序方式是由小到大的顺序。例:int buff[100];(其中含有100未排序元素)printf("%d",is_sorted(buff,buff+100));此时输出是0若buff[100]中含有100从小到...

2020-02-06 18:52:48 422

navi猫15版本本体加register

亲测可用

2022-01-29

空空如也

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

TA关注的人

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