摘要: ###1163 Dijkstra Sequence (30 分) Dijkstra's algorithm is one of the very famous greedy algorithms. It is used for solving the single source shortest p 阅读全文
posted @ 2022-02-13 02:10 别问了我什么都不会 阅读(351) 评论(0) 推荐(0)
摘要: ###1162 Postfix Expression (25 分) Given a syntax tree (binary), you are supposed to output the corresponding postfix expression, with parentheses refl 阅读全文
posted @ 2022-02-13 00:34 别问了我什么都不会 阅读(104) 评论(0) 推荐(0)
摘要: ###1161 Merging Linked Lists (25 分) Given two singly linked lists L1 = a1 → a2​ → ⋯ →an-1​ →a n and L2 =b 1 → b2→ ⋯ → bm-1 → bm.If n≥2m, you are suppo 阅读全文
posted @ 2022-02-12 23:10 别问了我什么都不会 阅读(155) 评论(0) 推荐(0)
摘要: ###1160 Forever (20 分) "Forever number" is a positive integer A with K digits, satisfying the following constrains: the sum of all the digits of A is 阅读全文
posted @ 2022-02-12 02:41 别问了我什么都不会 阅读(274) 评论(0) 推荐(0)
摘要: #一、助教工作的具体职责和任务 1.对同学遇到的问题进行解答 2.统计作业完成情况 3.将作业解答思路写出,放在博客园上供同学们参考 5.负责各种事情统计,如作业完成情况,进群人员核对等 #二、助教工作的每周时长和具体安排 1.每周时间不定,看作业布置情况,难度大同学们遇到的问题多,来问问题的人多, 阅读全文
posted @ 2021-08-13 22:58 别问了我什么都不会 阅读(1090) 评论(1) 推荐(0)
摘要: #树的重心 重心定义:重心是指树中的一个结点,如果将这个点删除后,剩余各个连通块中点数的最大值最小,那么这个节点被称为树的重心。 #include <iostream> #include <cstdio> using namespace std; const int N = 20010; int e 阅读全文
posted @ 2021-07-26 19:09 别问了我什么都不会 阅读(64) 评论(0) 推荐(0)
摘要: ##八数码问题 #include <iostream> #include <cstdio> #include <unordered_map> #include <cstring> #include <queue> using namespace std; int dfs(string start) 阅读全文
posted @ 2021-07-25 03:03 别问了我什么都不会 阅读(71) 评论(0) 推荐(0)
摘要: ##n皇后问题 #include<iostream> #include <cstdio> #include <cstring> using namespace std; const int N = 20; int n; char g[N][N]; int col[N],dg[N],udg[N]; v 阅读全文
posted @ 2021-07-23 11:39 别问了我什么都不会 阅读(46) 评论(0) 推荐(0)
摘要: AcWing 841. 字符串哈希 #include <iostream> using namespace std; typedef unsigned long long ULL; const int P = 131, N = 100010; ULL h[N], p[N]; char str[N]; 阅读全文
posted @ 2021-07-16 19:23 别问了我什么都不会 阅读(46) 评论(0) 推荐(0)
摘要: 排列数字 AcWing 94. 递归实现排列型枚举 #include<stdio.h> #define X 20 int n; int used[X]; int st[X]; void dfs(int u) { if(u>n){ for(int i = 1 ;i <= n ; i++) printf 阅读全文
posted @ 2021-07-16 18:06 别问了我什么都不会 阅读(61) 评论(0) 推荐(0)