![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
题解
文章平均质量分 55
彡倾灬染|
这个作者很懒,什么都没留下…
展开
-
SDUT数据结构PTA专题(实验八)题解
数据结构与算法A实验八排序7-1 统计工龄 (20 分)7-2 寻找大富翁 (25 分)7-3 点赞狂魔 (25 分)7-4 插入排序还是归并排序 (25 分)7-5 逆序对 (15 分)7-6 第k数 (20 分)7-7 堆排序 (10 分)7-8 快速排序 (10 分)7-9 归并排序 (20 分)7-10 逆序对的数量 (20 分)7-1 统计工龄 (20 分)#include<bits/stdc++.h>#define eb emplace_back#define PSI pai原创 2021-12-04 21:51:13 · 1734 阅读 · 0 评论 -
SDUT数据结构PTA专题(实验七)题解
数据结构与算法A实验七查找7-1 电话聊天狂人 (25 分)7-2 两个有序序列的中位数 (25 分)7-3 词频统计 (30 分)7-4 集合相似度 (25 分)7-5 悄悄关注 (25 分)7-6 单身狗 (25 分)7-7 词典 (15 分)7-8 中序遍历树并判断是否为二叉搜索树 (20 分)7-1 电话聊天狂人 (25 分)#include<bits/stdc++.h>#define x first#define y secondusing namespace std;m原创 2021-12-04 14:53:45 · 1440 阅读 · 0 评论 -
SDUT《 算法分析与设计》 实验四-搜索算法
搜索算法A - 子集和问题B - 运动员最佳匹配问题C - 工作分配问题D - 整数变换问题A - 子集和问题#include <iostream>#include<bits/stdc++.h>#define ll long longconst int N = 1e5 + 10;using namespace std;int n,c;int a[N];int sum=0;bool st[N];void DFS(int x){ if(sum>c)原创 2021-11-23 16:58:52 · 762 阅读 · 0 评论 -
SDUT《 算法分析与设计》 实验三-贪心算法
贪心算法A - 汽车加油问题B - 多元Huffman编码问题C - 装船问题D - 活动选择E - 最优合并问题F - 区间覆盖问题A - 汽车加油问题#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-11-23 16:56:11 · 884 阅读 · 0 评论 -
SDUT《 算法分析与设计》 实验二-动态规划
动态规划A - 高数Umaru系列(9)——哈士奇B - 最少硬币问题C - 数字三角形问题D - 石子合并问题E - 最长公共子序列问题A - 高数Umaru系列(9)——哈士奇#include <iostream>#include <algorithm>#include<bits/stdc++.h>#define ll long long#define mem(a,b) memset(a,b,sizeof a)#define ull unsigned l原创 2021-11-23 16:41:05 · 941 阅读 · 0 评论 -
SDUT《 算法分析与设计》 实验一-分治算法
分治算法A - 众数问题B - 整数因子分解问题C - 顺序表应用7:最大子段和之分治递归法D - 骨牌铺方格A - 众数问题#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 0x3f3f原创 2021-11-23 16:33:06 · 421 阅读 · 0 评论 -
SDUT数据结构PTA专题(实验六)题解
数据结构与算法A实验六图论7-9 最短路径 (20 分)7-12 Dijkstra算法(模板) (30 分)7-9 最短路径 (20 分)#include<bits/stdc++.h>#define ll long long#define mem(a,b) memset(a,b,sizeof a)#define inf 0x3f3f3f3f#define PII pair<int,int>#define PLL pair<ll,ll>#define x f原创 2021-11-01 17:22:38 · 1762 阅读 · 1 评论 -
SDUT数据结构PTA专题(实验五)题解
数据结构与算法A实验五树和二叉树7-1 还原二叉树 (25 分)7-4 树的遍历 (25 分)7-1 还原二叉树 (25 分)#include<bits/stdc++.h>#define ll long longconst int N = 2e5 + 10;using namespace std;int n; // 节点数char pre[N]; // 记录前序遍历char mid[N]; // 记录中序遍历struct node{ // 树结构体 char原创 2021-10-30 16:13:55 · 1275 阅读 · 0 评论 -
SDUT数据结构PTA专题(实验三)题解
数据结构与算法A实验三栈和队列7-1 进制转换7-1 进制转换答案:#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 0x3原创 2021-10-09 21:33:19 · 1803 阅读 · 2 评论 -
SDUT数据结构PTA专题(实验二)题解
数据结构与算法A实验二链表7 - 1 单链表的创建及遍历7 - 2 两个有序链表序列的合并7 - 3 单链表的创建,遍历与销毁7 - 6 删除重复字符7 - 10 链表去重7 - 11 单链表就地逆置7 - 1 单链表的创建及遍历#include<bits/stdc++.h>using namespace std;struct node{ // 定义节点结构体 int data; // 值 node *next; // 指向下一个节点的索引};node *b原创 2021-09-28 11:56:24 · 1635 阅读 · 1 评论 -
SDUT数据结构PTA专题(实验一)题解
@TOC两个有序链表序列的合并题目链接答案:#include<bits/stdc++.h>using namespace std;struct node{ // 定义节点结构体 int data; // 值 node *next; // 指向下一个节点的索引};node *build(node *head){ // 建立链表 head=new node; node *tail,*p; head->next=NULL;原创 2021-09-27 11:43:57 · 1577 阅读 · 0 评论 -
SDUT 编译原理实验代码
编译原理实验A - 小C语言--词法分析程序A - 小C语言–词法分析程序题目链接答案:#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#def原创 2021-09-16 14:53:18 · 587 阅读 · 0 评论 -
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 · 151 阅读 · 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 · 1045 阅读 · 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 · 387 阅读 · 0 评论 -
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 · 403 阅读 · 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 · 283 阅读 · 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 · 224 阅读 · 0 评论 -
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 · 150 阅读 · 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 · 357 阅读 · 0 评论 -
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 · 291 阅读 · 0 评论 -
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 · 1157 阅读 · 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 · 389 阅读 · 0 评论 -
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 · 318 阅读 · 0 评论 -
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 · 1258 阅读 · 0 评论 -
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 · 524 阅读 · 3 评论 -
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 · 327 阅读 · 0 评论 -
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 · 130 阅读 · 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 · 113 阅读 · 1 评论 -
操作系统 专题九 基础算法(BA)代码
前言最终解释权归 彡倾灬染| 所属使用时注意检查结果如果有错误请及时反馈(Thanks)可以计算的题型仅限于我刷到过的,要是有新题型请联系我添加(蟹蟹)笔芯❤代码/**备注: *最终解释权归 彡倾灬染| 所属 *使用时注意检查结果 *如果有错误请及时反馈(Thanks) *可以计算的题型仅限于我刷到过的,要是有新题型请联系我添加(蟹蟹) *笔芯❤ */#include <iostream>#include <algorithm>#include原创 2021-05-17 20:38:49 · 517 阅读 · 0 评论 -
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 · 262 阅读 · 0 评论 -
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 · 1038 阅读 · 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 · 237 阅读 · 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 · 728 阅读 · 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 · 182 阅读 · 0 评论 -
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 · 116 阅读 · 0 评论 -
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 · 588 阅读 · 0 评论 -
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 · 434 阅读 · 0 评论 -
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 · 224 阅读 · 0 评论 -
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 · 157 阅读 · 0 评论