酸甜苦辣复何求
酸甜苦辣复何求
全部文章
分类
题解(3)
归档
标签
去牛客网
登录
/
注册
酸甜苦辣复何求的博客
全部文章
(共38篇)
题解 | #【模板】哈夫曼编码#
#include <stdio.h> //除了小顶堆,不需要任何其他数据结构 //插入 void HeapInsert(long long* Heap, long long val, int size) { Heap[size] = val; while (Heap[si...
2024-05-14
1
177
题解 | #【模板】完全背包#
#include <stdarg.h> #include <stdio.h> #include<malloc.h> //完全背包和01背包的唯一区别就是两层循环中再添加一层, /* 2 6 5 10 3 1 理解成: 2 6 5 10 5 10 3 1 3 1 ...
2024-05-09
0
181
题解 | #【模板】01背包#
#include <stdarg.h> #include <stdio.h> #include<malloc.h> int main() { int volume; int quantity; scanf("%d %d&q...
2024-05-09
0
188
题解 | #【模板】单源最短路2#
#include <limits.h> #include <stdio.h> #include <malloc.h> #define MAX 5000 int main() { // 好坑呀,这里一定要MAX int n; int m; ...
2024-04-20
0
188
题解 | #连续子数组最大和#
#include <stdio.h> #include <malloc.h> //关键点在第17行,理解为如果前面的累加结果是累赘即<0,那么就断掉 int main() { int len ; scanf("%d",&len); int *...
2024-04-17
0
180
题解 | #【模板】循环队列#
#include <stdio.h> #include<malloc.h> int main() { int space; scanf("%d", &space); int times; scanf("...
2024-03-23
0
205
题解 | #【模板】队列#
#include <stdio.h> #include<malloc.h> int main() { int times ; scanf("%d",×); int queue[100000]; int head =0; int tail = 0; for(...
2024-03-22
0
192
题解 | #点击消除#
#include <stdio.h> #include <string.h> int main() { // 相同就出栈,不同就入栈 char str[300000]; scanf("%s",str); int len = strlen(str);...
2024-03-22
0
195
题解 | #逆波兰表达式求值#
/**用一个栈,数字就入,运算符就取两个计算 * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param tokens string字符串一维数组 * @param tokensLen int tokens数组长度 * @return int整...
2024-03-22
0
241
题解 | #【模板】栈#
#include <stdio.h> #include <malloc.h> #include <string.h> int main() { int operation; scanf("%d",&operation); int arr...
2024-03-22
0
192
首页
上一页
1
2
3
4
下一页
末页