![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT
文章平均质量分 65
菜逼庄水水
菜鸡,ZJU研究僧在读,VR/游戏开发方向
展开
-
PAT A 1001 -菜逼刷题
1001 A+B Format Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input Specification...原创 2018-12-11 20:53:24 · 123 阅读 · 0 评论 -
PAT A1002 菜逼刷题
1002 A+B for Polynomials (25 分) This time, you are supposed to find A+B where A and B are two polynomials. Input Specification: Each input file contains one test case. Each case occupies 2 lines, and ...原创 2018-12-11 22:06:02 · 166 阅读 · 0 评论 -
PAT//迪杰特斯拉算法
Dijkstra算法是典型的最短路径路由算法,用来计算一个节点到其他所有节点的最短路径。 思路如下: 1.初始化距离d[] 2.找到未访问的最近的值,记录下来temp; 3.以temp为基准更新d[] C++实现如下 void DJ(int x){ fill(d, d + maxn, INF); d[x] = 0; for (int i = 0; i < n; i++){ int ...原创 2019-01-08 18:18:10 · 251 阅读 · 0 评论 -
PAT 1034Head of a Gang
1034 Head of a Gang (30 分) One way that the police finds the head of a gang is to check people’s phone calls. If there is a phone call between A and B, we say that A and B is related. The weight of a ...原创 2019-02-07 22:43:03 · 102 阅读 · 0 评论 -
PAT-排队等待问题A1014/1017/1026总结
模型: 去银行等场所排队入场/N个窗口(球台),每个窗口后m人排队/按照时间顺序排队/其他人在等待区域/按时(8:00)开门(17:00)关门 表述不太清楚、是十分贴近现实的银行办事排队的模型 A1014是个基本的model,要求输出的是何时能够办事结束// 模型认为所有的顾客都是在8:00进入排队序列 首先建立一个队列模型: struct node{ int poptime,Endtime; q...原创 2019-02-14 12:59:06 · 332 阅读 · 0 评论