• About Me

KuangKuang's Blog


习惯就是人生最大指导
线性表相关操作
考研数据结构

线性表相关操作

顺序表逆置 void inverse(int a[], int n){ int t; for(int i = 0; i < n; i ++){ t = a[i]; a[i] = a[n - i - 1]; a[n …

2021年12月18日 0条评论 156次阅读 1人点赞 KuangKuang 阅读全文
树的遍历转换
考研数据结构

树的遍历转换

已知二叉树先序和中序遍历,求树的高度 #include <bits/stdc++.h> using namespace std; const int maxn = 1000; typedef struct B…

2021年12月10日 0条评论 137次阅读 1人点赞 KuangKuang 阅读全文
考研算法题
考研数据结构

考研算法题

反转链表 题目链接 方法一: 双指针:在遍历链表同时修个节点next的指向。 时间复杂度\mathcal{O(n)} 空间复杂度\mathcal{O(1)} typedef sturct ListNode{ int da…

2021年12月8日 0条评论 185次阅读 0人点赞 KuangKuang 阅读全文
考研数据结构关于图的操作
考研数据结构

考研数据结构关于图的操作

邻接表建图输出每个节点的度 #include <bits/stdc++.h> using namespace std; const int maxn = 1000; //定义边表节点结构 typedef st…

2021年12月6日 0条评论 142次阅读 0人点赞 KuangKuang 阅读全文
二叉树相关操作
考研数据结构

二叉树相关操作

二叉树建立与遍历 #include <bits/stdc++.h> using namespace std; typedef struct BTNode{ int data; struct BTNode *l…

2021年12月5日 0条评论 165次阅读 0人点赞 KuangKuang 阅读全文
算法竞赛进阶指南-0x06基本算法-倍增
算法竞赛进阶指南

算法竞赛进阶指南-0x06基本算法-倍增

天才ACM 题意: 蓝书P40 Solution: 很详细的题解 Code: int Te, n, m; ll a[N], t[N], tmp[N], T; bool check(int l, int mid, int …

2021年5月30日 0条评论 324次阅读 0人点赞 KuangKuang 阅读全文
算法竞赛进阶指南-0x05基本算法-排序
算法竞赛进阶指南

算法竞赛进阶指南-0x05基本算法-排序

电影 题意: 蓝书P33 Solution: 离散化板子题 Code: #include <bits/stdc++.h> using namespace std; const int N = 2e5 + 10…

2021年5月30日 0条评论 235次阅读 0人点赞 KuangKuang 阅读全文
算法竞赛进阶指南-0x07基本算法-贪心
算法竞赛进阶指南

算法竞赛进阶指南-0x07基本算法-贪心

防晒 题意: 蓝书P42 Solution: 将所有奶牛按照 minSPF 从大到小的顺序排序,然后依次考虑每头奶牛; 对于每头奶牛,扫描当前所有能用的防晒霜,选择 SPF 值最大的防晒霜来用; Code: int n,…

2021年5月29日 0条评论 185次阅读 0人点赞 KuangKuang 阅读全文
Codeforces Round #723 (Div. 2)
Codeforces

Codeforces Round #723 (Div. 2)

A. Mean Inequality 题意: 给定 2n (n为偶数) 个互不相同的元素,求一个排列使得,对于所有 i 满足 a_i \ne \frac{a_{i-1}a_{i+1}}{2} Solution: 从小到大…

2021年5月29日 0条评论 253次阅读 1人点赞 KuangKuang 阅读全文
Codeforces Round #722 (Div. 2)
Codeforces

Codeforces Round #722 (Div. 2)

A. Eshag Loves Big Arrays 题意: 给定一个长度为 n 的序列,可以选择一段区间将其中严格大于区间平均数的数删掉,可以执行任意多次,问最多可以删除多少次。 Soulution: 删到最后一定只剩下…

2021年5月25日 0条评论 255次阅读 1人点赞 KuangKuang 阅读全文
  • 1
  • 2
  • 3
  • 4
  • >
  • »

分类

  • Codeforces
  • kuangbin并查集专题
  • Kuangbin数论专题
  • kuangbin线段树专题
  • upc个人训练赛
  • 位运算
  • 博弈论
  • 多校训练
  • 搜索
  • 数据结构
  • 数论
  • 深入理解计算机基础/CSAPP
  • 矩阵线性代数
  • 算法模板
  • 算法竞赛进阶指南
  • 考研数据结构
  • 训练赛

© 2022 我的个人记载. All Rights Reserved. | 已在风雨中度过 Loading...
Theme Kratos Made by Vtrois Modified by Moedog
苏ICP备19034952号