自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

码立的博客

分享知识,每天进步一点点。

  • 博客(15)
  • 资源 (1)
  • 收藏
  • 关注

原创 【基础数学】计数原理

车的攻击题目描述//用set只能得50分,因为部分会超时#include<iostream>#include<set>using namespace std;int main() { int n, k, r, c; set <int> s1, s2; cin >> n >> k; for(int i = 0; i < k; i++) { cin >> r >> c; s1.insert(

2022-04-05 18:30:08 148

原创 【基础数学】进制转换与位运算

找筷子题目描述#include<cstdio>int x, n, ans;int main() { scanf("%d", &n); for(int i = 1; i <= n; i++) { scanf("%d", &x); ans ^= x; } printf("%d\n", ans);}高低位交换题目描述#include<bits/stdc++.h>using namespace std;i

2022-04-04 18:17:52 262

原创 【数据结构】线性表

寄包柜题目描述#include<iostream> #include<vector>using namespace std;int n, q, opt, i ,j, k;int main() { cin >> n >> q; vector< vector<int> > locker(n + 1); while(q--) { cin >> opt; if(opt == 1) { cin &g

2022-03-30 20:50:57 1420

原创 【基础算法】贪心策略

合并果子题目描述#include<iostream> #include<algorithm>#include<cstring>using namespace std;int main() { int n, a[10010], b[10010]; cin >> n; memset(a, 127, sizeof(a)); //127为初始化为一个很大且接近int类型上限的正数 memset(b, 127, sizeof(b)); fo

2022-03-28 11:45:26 333

原创 【基础算法】递推与递归

过河卒题目描述#include<iostream>#define MAXN 25using namespace std;// 马的控制范围 const int fx[] = {0, -2, -1, 1, 2, 2, 1, -1, -2};const int fy[] = {0, 1, 2, 2, 1, -1, -2, -2, -1};int s[MAXN][MAXN];long long f[MAXN][MAXN]; //结果可能很大,设为long long int m.

2022-03-20 14:03:32 152

原创 【基础算法】暴力枚举

统计方形加强版题目描述#include<iostream>#include<cstdio>using namespace std;typedef long long ll;int main() { ll n, m, squ = 0, rec = 0; scanf("%lld%lld", &n, &m); for(ll x = 0; x <= n; x++) for(ll y = 0; y <= m; y++) { ll

2022-03-08 16:51:27 737

原创 【基础算法】排序sort函数

生日题目描述#include<iostream>#include<cstdio>#include<algorithm>#include<string>using namespace std;int const MAXN = 105;struct schoolmate { string s; int y, m, d, id;}sc[MAXN];int cmp(schoolmate a, schoolmate b) { if(a.

2022-03-06 18:11:03 242

原创 【入门模拟】字符串展开

字符串的展开题目描述//解法一#include<bits/stdc++.h>using namespace std;int main() { string s; int p1, p2, p3; char be, af, f; cin >> p1 >> p2 >> p3 >> s; for(int i = 0; i < s.length(); i++) { be = s[i-1]; af = s[i+1];

2022-03-02 14:09:22 448

原创 【入门模拟】形状与转换

方块转换题目描述#include<bits/stdc++.h>using namespace std;#define N 15 int n;char a[N][N], b[N][N], c[N][N];void reset() { // 重置矩阵 for(int i = 1; i <= n; i++) for(int j = 1; j <= n; j++) a[i][j] = b[i][j]; }bool check(char l[][N], .

2022-02-24 16:14:49 354

原创 【基础算法】大整数运算

阶乘之和(高精度)#include<iostream>#include<cstring>using namespace std;#define maxn 100struct Bigint { int len, a[maxn]; Bigint (int x = 0) { //构造函数,进行初始化 memset(a, 0, sizeof(a)); for(len = 1; x; len++) { //x由循环内执行改变,为0时跳出循环 a[len]

2022-02-23 17:29:26 205

原创 Python实现im2col和col2im函数完整代码

在这里先贴上了实现im2col和col2im函数的代码,已覆盖了基本功能,供大家调用学习,后续会附上两个函数的相关解析。实现im2col函数:import numpy as npdef im2col(img, kernel_size, strides=1, paddings=0, dilations=1): if not isinstance(kernel_size, list): k = kernel_size kernel_size = [k, k

2022-01-27 15:43:18 3370

原创 数据结构严蔚敏(c语言版)课后算法题答案-树和二叉树

以二叉链表作为二更树的存储结构, 编写以下算法:(1) 统计二叉树的叶结点个数。int leafnumber(BiTree &T) 统计二叉树叶结点个数{ if(T==NULL) return 0; else if(T->lchild==NULL&&T->rchild==NULL) return 1; else return leafnumber(T->rchild)+leafnumber(T->lchild);}.

2022-01-27 15:14:50 1677

原创 数据结构严蔚敏(c语言版)课后算法题答案-栈和队列

( 2 )回文是指正读反读均相同的字符序列, 如"abba ” 和“ abdba ” 均是回文, 但"good"不是回文。试写一个算法判定给定的字符向量是否为回文。( 提示: 将一半字符入栈)#include<stdio.h> //判定是否回文#include<string.h>#define maxsize 100typedef struct{ char base[maxsize]; char *top; }stack; int Huiwen(char *t

2022-01-27 15:09:42 1672

原创 数据结构严蔚敏(c语言版)课后算法题答案-线性表

( 1 )将两个递增的有序链表合并为一个递增的有序链表。要求结果链表仍使用原来两个链表的存储空间,不另外占用其它的存储空间。表中不允许有重复的数据。#include<stdio.h> typedef struct Lnode{ int data; struct Lnode *next; } Lnode,*Link;void createlist(Link &L,int n,int z[]);void listput(Link &L1,Link &L.

2022-01-27 14:34:13 1947

原创 操作系统五大经典算法代码

操作系统经典算法总结

2022-01-27 12:55:19 1089 1

python攻防小游戏设计实战代码

资源内容:用python手写了一个攻防游戏程序,大概一千多行代码。 使用:可以拿来在基础上修改完善学习,也可以当作一个程序设计大作业。

2022-03-13

空空如也

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

TA关注的人

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