随笔分类 - 链表
摘要:题目1链接 有序序列合并 写法1:数组模拟 #include<bits/stdc++.h> using namespace std; int a1[20], a2[20], a[40]; int main() { int n=15; for(int i=1; i<=n; i++)cin>>a1[i]
阅读全文
摘要:题目链接:https://www.luogu.com.cn/problem/P3916 链式前向星详细教程:https://www.bilibili.com/video/BV13r4y1X7a4/?spm_id_from=333.788 1 #include<bits/stdc++.h> 2 con
阅读全文
摘要:题目链接https://www.luogu.com.cn/problem/P1160 很裸的一道队列的题 方法一:没审清题目,,直接就来写,笨笨得每次都扫描一遍链表导致TLE,最后得分40分 1 #include<bits/stdc++.h> 2 using namespace std; 3 int
阅读全文
摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 4 const int maxn=1010; 5 struct node{ //point即指针,data就是需要维护的数据 6 int point,data; 7 }a[maxn]; 8 int
阅读全文
摘要:1 #include<iostream> 2 using namespace std; 3 struct lb{ 4 int data; 5 int next; 6 }a[15]; 7 int main() 8 { 9 int n, x; 10 cin>>n; 11 for(int i=1; i<=
阅读全文