05 2022 档案
摘要:简单题,溜溜手。 C: #include <stdlib.h> #include <string.h> void allocation(int *givenArr, int currentCandie, int currentPeople, int candies, int num_people)
阅读全文
摘要:C: // 队列与栈 struct Node { int val; int depth; struct Node *next; struct Node *pre; }; struct Queue { struct Node *head; struct Node *last; int len; };
阅读全文
摘要:先计算最长公共子序列,然后以最长公共子序列为 base ,与两个原序列合并。 dp 后恢复子序列的手法很关键 C: #include <stdlib.h> #include <stdio.h> #include <string.h> char *combine(char *base, char *s
阅读全文
摘要:C: #include <stdio.h> #include <stdlib.h> int dp(int *prices, int fee, int point, int hasShared, int *cache) { if (point == 0) { if (hasShared == 0) r
阅读全文
摘要:C 手写栈结构: #include <stdlib.h> #include <stdio.h> #include <string.h> #include "stdbool.h" struct Node { char val; int num; struct Node *next; struct No
阅读全文