- 博客(307)
- 收藏
- 关注
原创 AcWing算法基础课----数据结构(一) 笔记 (链表和邻接表 + 栈与队列 +KMP)
数据结构1.链表与邻接表1. 数组模拟单链表 (用的多的是 邻接表:存储数和图)2. 数组模拟双链表 (优化某些问题)2.栈与队列1. 模拟栈(先进后出)2. 模拟队列(先进先出)3.单调栈4.单调队列3.KMP1.链表与邻接表动态链表时间太长(new node)采用:数组模拟链表1. 数组模拟单链表 (用的多的是 邻接表:存储数和图)定义 : e 值 | ne 某点next指针(空节点-1) |int e[N],ne[N]关联:e和ne 通过下标模板静态链表(快!)// head存
2021-07-26 10:09:28
794
原创 Codeforces Round #727 (Div. 2) 题解
Div. 2 727官方题解A - Contest StartB - Love SongC - Stable GroupsD - PriceFixedF - Strange Array (补)官方题解传送门A - Contest Start题目链接答案#include <iostream>#include <algorithm>#include<bits/stdc++.h>#define ll long long#define mem(a,b) mem
2021-06-22 17:22:23
158
4
原创 SDUT 2021 Spring Team Contest--- 24(Gym 103145) 题解
Gym 103145E - Easy Math ProblemI - TakeawayJ - TransformK - CityM - Master of ShuangpinE - Easy Math Problem题目链接答案#include <iostream>#include <algorithm>#include<bits/stdc++.h>#define ll long long#define mem(a,b) memset(a,b,sizeof
2021-06-19 17:40:05
1123
2
原创 Codeforces Round #726 (Div. 2) 题解
726官方题解A - Arithmetic ArrayB - Bad BoyC - Challenging CliffsD - Deleting DivisorsE1 - Erase and Extend (Easy Version)E2 - Erase and Extend (Hard Version) (补)F - Figure Fixing(补)官方题解传送门A - Arithmetic Array题目链接答案#include <iostream>#include <a
2021-06-19 10:48:30
437
原创 SDUT 2021 Spring Team Contest--- 23 (Kattis) 题解
KattisC - Cryptographer's ConundrumD - Disastrous DowntimeE - Entertainment BoxG - Goblin Garden GuardsF - Floppy Music (补)C - Cryptographer’s Conundrum题目链接答案#include <iostream>#include <algorithm>#include<bits/stdc++.h>#define ll
2021-06-14 21:33:11
465
1
原创 Codeforces Round #725 (Div. 3) 题解
725 Div. 3A - Stone GameB - Friends and CandiesC - Number of PairsD - Another Problem About Dividing NumbersF - Interesting FunctionA - Stone Game题目链接答案#include <iostream>#include <algorithm>#include<bits/stdc++.h>#define ll long l
2021-06-11 19:39:48
327
1
原创 Educational Codeforces Round 110 (Rated for Div. 2) 题解
Round 110A - Fair PlayoffB - Array ReoderingC - Unstable StringA - Fair Playoff题目链接答案#include <iostream>#include <algorithm>#include<bits/stdc++.h>#define ll long long#define mem(a,b) memset(a,b,sizeof a)#define ull unsigned long
2021-06-09 21:32:35
274
原创 SDUT 2021 Spring Individual Contest - M (Kattis) 题解
@ TOCA - Bingo Ties题目链接答案#include <iostream>#include <algorithm>#include<bits/stdc++.h>#define ll long long#define mem(a,b) memset(a,b,sizeof a)#define ull unsigned long long#define INF 0x3f3f3f3f3f3f3f3f#define inf 0x3f3f3f3f
2021-06-09 09:57:44
176
1
原创 SDUT 2021 Spring Individual Contest - L (Gym - 101873)题解
Gym - 101873题面链接D - Pants On FireG - Water TestingI - UberwatchC - Joyride(补)题面链接传送门D - Pants On Fire题目链接答案#include <iostream>#include <algorithm>#include<bits/stdc++.h>#define ll long long#define mem(a,b) memset(a,b,sizeof a)#
2021-06-02 10:05:35
397
原创 SDUT 2021 Spring Team Contest--- 21 (Kattis) 题解
KattisC - Jumbled CommunicationD - DreamerG - Gotta Catch Em All!I - I Wanna Be The Very BestJ - Joyless GameC - Jumbled Communication题目链接答案#include <bits/stdc++.h>using namespace std;const int N=100050;vector<int>q;int ans[10];int xl
2021-05-30 17:38:12
346
原创 SDUT 2021 Spring Team Contest--- 20 (Gym 103107)题解
Gym 103107DD - Doin' TimeF - FunctionH - Hack DSU!J - JOJO's FactoryK - Keep EatingD - Doin’ Time题目链接答案#include <iostream>#include <algorithm>#include<bits/stdc++.h>#define ll long long#define mem(a,b) memset(a,b,sizeof a)#define
2021-05-29 17:33:27
1233
1
原创 Codeforces Round #723 (Div. 2) 题解
#723A - Mean InequalityB - I Hate 1111C1 - Potions (Easy Version)C2 - Potions (Hard Version)晚上再补题吧A - Mean Inequality题目链接答案#include <iostream>#include <algorithm>#include<bits/stdc++.h>#define ll long long#define mem(a,b) memset(
2021-05-29 10:15:12
463
原创 计算机组成原理期末复习 第一章
第一章 计算机系统概论1.1 计算机的分类1.2 计算机的性能指标1.1 计算机的分类电子计算机分类:电子模拟计算机特点:数值由连续量来表示,运算过程也是连续的电子数字计算机特点:按位运算,并且不连续地跳动计算电子数字计算机分类:划分依据:根据计算机的效率、速度、价格、运行的经济性和适应性来划分专用计算机通用计算机可分为:超级计算机、大型机、服务器、PC机、单片机和多核机六类区别:体积、简易性、功率损耗、性能指标、数据存储容量、指令系统规模和机器价格1.2 计算机的性能指
2021-05-28 21:13:49
478
3
原创 AcWing算法基础课----基础算法(二) 习题题解
基础算法一 习题基础知识讲解链接791. 高精度加法792. 高精度减法793. 高精度乘法794. 高精度除法795. 前缀和796. 子矩阵的和797. 差分798. 差分矩阵基础知识讲解链接传送门791. 高精度加法题目链接答案#include <iostream>#include <algorithm>#include<bits/stdc++.h>#define ll long long#define mem(a,b) memset(a,b,s
2021-05-24 20:55:38
380
原创 AcWing算法基础课----基础算法(二) 笔记 (高精度算数 + 前缀和 + 差分)
基础算法高精度前缀和与差分高精度常用分类:两个大整数相加(A+B) A和B位数大约为1e6两个大整数相减(A-B) A和B位数大约为1e6一个大整数乘一个小整数(A*a)len(A)<=1e6 / a<=1e9一个大整数除一个小整数(A/a) len(A)<=1e6 / a<=1e9大整数如何存储:每一位存到数组中(从个位开始存较好)思路:A+B(模拟人工加法)C[i]=A[i]+B[i]+t(上一位进位)模板// C = A + B, A >
2021-05-24 17:02:35
410
原创 7-8 浪漫侧影 (25 分) PTA520 钻石挑战赛
题目链接输入样例:86 8 7 4 5 1 3 28 5 4 7 6 3 2 1输出样例:R: 1 2 3 4 5L: 1 6 7 8 5答案#include <iostream>#include <algorithm>#include<bits/stdc++.h>#define ll long long#define mem(a,b) memset(a,b,sizeof a)#define ull unsigned long long
2021-05-20 11:30:06
1311
原创 AcWing算法基础课----基础算法(一) 习题题解
基础算法一 习题基础知识讲解链接785 快速排序786 第k个数787 归并排序788 逆序对的数量789 数的范围790 数的三次方根基础知识讲解链接传送门785 快速排序题目链接答案#include<bits/stdc++.h>const int N = 1e5 + 10;using namespace std;int dp[N];void quick_sort(int q[], int l, int r) { if (l >= r) return;
2021-05-19 21:06:09
630
3
原创 AcWing算法基础课----基础算法(一) 笔记 (排序 + 二分)
基础算法 排序快速排序归并排序二分整数二分浮点数二分排序学习方法:学习代码的主要思想模板理解+记忆刷题(模板题默写3~5遍)快速排序快排 --> 基于分治y总快排讲解思想:确定分界点(通常为 q[l]、q[(l+r)/2]、q[r]、随机(不常用))★调整区间☆ —>划分为两个区间,第一个区间所有数都小于等于x,第二个区间所有数都大于等于x递归处理左右两端模板:void quick_sort(int *q,int l,int r){ if(l>
2021-05-19 17:07:58
468
原创 SDUT 2021 Spring Individual Contest - J (计蒜客)题解
计蒜客A - ArchitectureB - Bracket SequenceD - Deceptive DiceF - Floor PlanG - Greetings!I - Inquiry IH - Hexagonal Rooks(补)A - Architecture题目链接答案#include <bits/stdc++.h>#include <algorithm>#include <iostream>#define ll long long#def
2021-05-19 14:28:21
378
原创 Count Color (线段树)
题目链接Sample Input2 2 4C 1 1 2P 1 2C 2 2 2P 1 2Sample Output21答案#include <algorithm>#include <bitset>#include <cmath>#include <cstdio>#include <cstdlib>#include <cstring>#include <deque>#include
2021-05-18 16:00:01
144
1
原创 Educational Codeforces Round 109 (Rated for Div. 2) 题解
题目A - Potion-makingB - Permutation SortD - ArmchairsA - Potion-making题目链接答案#include <iostream>#include <algorithm>#include<bits/stdc++.h>#define ll long long#define mem(a,b) memset(a,b,sizeof a)#define ull unsigned long long#def
2021-05-18 15:29:07
126
1
原创 SDUT 2021 Spring Team Contest--- 17(Kattis) 题解
KattisA - Abstract PaintingD - Dating timeI - Inspecting IlluminationM - Moscow DreamG - Generating Numbers(补)A - Abstract Painting题目链接答案#include <bits/stdc++.h>using namespace std;#define ll long long int arr[30][3000];void solve(){ int
2021-05-16 19:32:10
307
原创 SDUT 2021 Spring Team Contest--- 16(Gym 103081) 题解
Gym 103081A - GratitudeC - Safe DistanceD - JoggingE - CakesK - Unique ActivitiesA - Gratitude题目链接答案:#include <math.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <algorithm>#include <deque>
2021-05-15 21:01:16
1118
2
原创 Codeforces Round #719 (Div. 3) 题解(详解)
@TOCA - Do Not Be Distracted!题目链接答案#include <iostream>#include<bits/stdc++.h>#define ll long long#define mem(a,b) memset(a,b,sizeof a)#define ull unsigned long long#define INF 0x3f3f3f3f3f3f3f3f#define rep(i,a,b) for(auto i=a;i<=b;
2021-05-06 00:39:45
250
8
原创 SDUT 2021 Spring Team Contest--- 11(Kattis)题解
KattisB - Baby BitesC - Code CleanupsH - House LawnI - Intergalactic BiddingJ - Jumbled StringB - Baby Bites题目链接答案#include <iostream>#include<bits/stdc++.h>#define ll long long#define mem(a,b) memset(a,b,sizeof a)#define ull unsigned lo
2021-05-01 21:39:24
769
1
原创 Educational Codeforces Round 108 (Rated for Div. 2)
Educational Codeforces Round 108A - Red and Blue BeansB - The Cake Is a LieC - Berland RegionalD - Maximum Sum of ProductsA - Red and Blue Beans题目链接答案#include <iostream>#include<bits/stdc++.h>#define ll long long#define mem(a,b) memset(a
2021-04-30 10:00:10
218
原创 Contest 2050 and Codeforces Round #718 (Div. 1 + Div. 2)
Round #718 A. Sum of 2050B - Morning JoggingC - Fillomino 2A. Sum of 2050题目链接答案#include <iostream>#include<bits/stdc++.h>#define ll long long#define mem(a,b) memset(a,b,sizeof a)#define ull unsigned long long#define INF 0x3f3f3f3f3f3f3
2021-04-29 19:53:03
125
原创 SDUT 2021 Spring Individual Contest - H(Gym - 103061)
Gym - 103061B - lazing RiffI - cy ResurrectionJ - uvenile GalantN - anikore昨天没打还没补完(待补ing)B - lazing Riff题目链接答案#include <iostream>#include<bits/stdc++.h>#define ll long long#define mem(a,b) memset(a,b,sizeof a)#define ull unsigned lon
2021-04-28 18:00:13
630
原创 SDUT 2021 Spring Team Contest--- 10(Gym 103055)
Gym 103055A - League of LegendsC - CubeJ - Grammy and JewelryL - String FreshmanM - Game TheoryA - League of Legends题目链接答案#include <iostream>#include<bits/stdc++.h>#define ll long long#define ull unsigned long long#define INF 0x3f3f3f3f
2021-04-28 17:56:12
445
原创 SDUT 2021年全国天梯赛赛前个人专题强化赛---3(搜索1)题解
搜索7-1 列出连通集 (25 分)7-2 Saving James Bond - Easy Version (25 分)7-3 地下迷宫探索 (30 分)7-4 畅通工程之局部最小花费问题 (35 分)7-5 List Components (25 分)7-6 排座位 (25 分)7-7 红色警报 (25 分)7-8 愿天下有情人都是失散多年的兄妹 (25 分)7-9 家庭房产 (25 分)7-10 功夫传人 (25 分)7-11 图着色问题 (25 分)7-12 拯救007 (25 分)7-1 列出连
2021-04-19 17:45:12
236
原创 Codeforces Round #713 (Div. 3) 题解
CodeforcesA. Spy Detected!B. Almost RectangleC - A-B PalindromeD - Corrupted ArrayE - Permutation by SumA. Spy Detected!题目链接答案#include<bits/stdc++.h>#define ll long longconst int N = 1e5 + 10;using namespace std;int dp[N];int main(){ i
2021-04-14 21:38:28
165
原创 SDUT2021年全国天梯赛赛前个人专题强化赛---2(排序2)题解
排序R7-1 模拟EXCEL排序 (25 分)R7-2 奥运排行榜 (25 分)R7-3 互评成绩 (25 分)R7-4 人以群分 (25 分)R7-5 点赞狂魔 (25 分)R7-6 名人堂与代金券 (25 分)R7-7 寻找大富翁 (25 分)R7-8 PAT排名汇总 (25 分)R7-1 模拟EXCEL排序 (25 分)题目链接答案#include<bits/stdc++.h>#define ll long long#define lb long double#define
2021-04-13 20:49:00
245
原创 Educational Codeforces Round 107 (Rated for Div. 2) 题解
CodeforcesA - Review SiteB - GCD LengthC - Yet Another Card DeckD - Yet Another Card DeckA - Review Site题目链接答案#include <iostream>#include<bits/stdc++.h>#define ll long longconst int N = 1e5 + 10;using namespace std;int main(){
2021-04-13 00:31:09
346
2
原创 SDUT2021年全国天梯赛赛前个人专题强化赛---1(排序1)题解
排序十大排序讲解传送门R7-1 魔法优惠券 (25 分)R7-2 抢红包 (25 分)R7-3 集合相似度 (25 分)R7-4 悄悄关注 (25 分)R7-5 月饼 (25 分)R7-6 单身狗 (25 分)R7-7 插入排序还是堆排序 (25 分)R7-8 插入排序还是归并排序 (25 分)十大排序讲解传送门十大排序讲解链接R7-1 魔法优惠券 (25 分)题目链接答案#include<bits/stdc++.h>#define ll long longconst int N
2021-04-12 21:16:44
417
原创 SDUT 2021 Spring Team Contest--- 9(Kattis)
KattisC - Contest StrugglesD - Dragon BallsH - Hot SpringsK - KeyboarddC - Contest Struggles题目链接答案#include <iostream>#include<bits/stdc++.h>#define ll long long#define PII pair<int,int>#define PSS pair<string,string>#define
2021-04-11 21:35:25
365
原创 L3-004 肿瘤诊断 (30 分)(三维BFS / 三维 DFS)
题目链接输入样例:3 4 5 21 1 1 11 1 1 11 1 1 10 0 1 10 0 1 10 0 1 11 0 1 10 1 0 00 0 0 01 0 1 10 0 0 00 0 0 00 0 0 10 0 0 11 0 0 0输出样例:26答案:法一:三维BFS#include <iostream>#include<bits/stdc++.h>#define ll long long#define PII pa
2021-04-10 21:20:30
281
1
原创 L2-018 多项式A除以B (25 分) (模拟)
题目链接输入样例:4 4 1 2 -3 1 -1 0 -13 2 3 1 -2 0 1输出样例:3 2 0.3 1 0.2 0 -1.01 1 -3.1大佬思路:数组模拟,数组下标是i的元素值代表的是指数为i的项的系数,并需要对缺幂项进行补零。如: 2x^4 + x^2 - 5x + 8 --> [8,-5,1,0,2]若A多项式的最高次幂为t1, B多项式的最高次幂为t2, 则第一次除法得到的商的最高次幂为t1 – t2, 最高次 幂的系数为A[t1] / B[t
2021-04-10 20:34:46
441
原创 L2-011 玩转二叉树 (25 分) (先序中序建立二叉树)
题目链接输入样例:71 2 3 4 5 6 74 1 3 2 6 5 7输出样例:4 6 1 7 5 3 2思路本题考查就是先序中序建立二叉树,看起来镜面操作花里胡哨,其实就是层序遍历的时候先把右子树放进去,再放左子树答案#include <iostream>#include<bits/stdc++.h>#define ll long long#define PII pair<int,int>#define PSS pair<str
2021-04-10 20:13:07
187
原创 L2-029 特立独行的幸福 (25 分)
题目链接输入样例 1:10 40输出样例 1:19 823 628 331 432 3注意:样例中,10、13 也都是幸福数,但它们分别依附于其他数字(如 23、31 等等),所以不输出。其它数字虽然其实也依附于其它幸福数,但因为那些数字不在给定区间 [10, 40] 内,所以它们在给定区间内是特立独行的幸福数。输入样例 2:110 120输出样例 2:SAD答案注意:如果mp数组太大且为int类型可能最后一个测试点会tle#include <iostre
2021-04-10 19:12:15
194
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅