![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
保研准备
保研的过程中一些零碎吧,可能意义不大,简单记录下吧
争渡!怎渡?
这个作者很懒,什么都没留下…
展开
-
试证明:当用n比特进行分组的编码时,若接收窗口等于1(即只能按序接收分组),那么如果要求连续ARQ协议能正常运行时,发送窗口大小是多少?
试证明:当用n比特进行分组的编码时,若接收窗口等于1(即只能按序接收分组),那么如果要求连续ARQ协议能正常运行时,发送窗口大小是多少? 网上的证明起来有些吃力,这里使用老师给的一个结论,可以迅速解答。 即发送窗口与接收窗口大小之和<=(n为分组的大小)...原创 2019-06-25 20:53:14 · 46236 阅读 · 8 评论 -
关于北美信号T1和欧洲信号E1的计算
北美的24路脉码调制简称T1,速率是1.544Mbit/s 欧洲的30路脉码调制简称E1,速率是2.048Mbit/s计算过程: 电话机的频带一般在300-3400HZ,根据奈奎斯特采样定理,最小的采样频率为频带最大值的两倍,即针对于电话机最小的采样频率为2*3400=6800,但是实际上我们取得值是8k。此作为前提 T1信号: T1共有24个话路,...原创 2019-06-26 10:40:22 · 40527 阅读 · 1 评论 -
PAT刷题过程中用到的algorithm 函数库
1.lower_bound() 二分查找功能:函数lower_bound()在first和last中的前闭后开区间进行二分查找,返回大于或等于val的第一个元素位置。如果所有元素都小于val,则返回last的位置.注意:如果所有元素都小于val,则返回last的位置,且last的位置是越界的! 关于前闭后开:想要使用二分法查找某个闭合区间[a,b],如果使用lower_bound()函数,那么一定要注意,最后要加1, lower_bound(a,b+1,x)2.upper_...原创 2020-06-15 11:23:24 · 27786 阅读 · 0 评论 -
C++ Vector、Queue、Stack,Set使用纪录
1.Vector添加元素----------push_back Vector是动态数组,是可以像普通数组那样按下标存取 迭代器问题,上面说到Vector是数组,那么是可以使用for循环0<i<xxx.size()的,但是Vector独有一个迭代器的遍历,在这里还是提一句吧。 for(vector<Msg>::iterator il=vecMsg.begin();il!=vecMsg.end();il++){ cout<<il->id; } ..原创 2020-05-11 22:44:45 · 38646 阅读 · 0 评论 -
C/C++ 刷PAT过程出现的问题汇总
1.error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> &g...原创 2020-04-27 18:05:33 · 39249 阅读 · 0 评论 -
PAT-A-1062 Talent and Virtue 【排序】
About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people's talent and virtue. According to his theory, a man being outstanding in both talent and virtue must be a "sage(圣人)"; being less excellent but with o原创 2020-05-25 15:16:00 · 67564 阅读 · 0 评论 -
PAT-A-1096 Consecutive Factors 【因数分解】
Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3×5×6×7, where 5, 6, and 7 are the three consecutive numbers. Now given any positive N, you are supposed to find the maximum num原创 2020-05-23 11:03:48 · 38886 阅读 · 0 评论 -
PAT-A1032 Sharing【链表】
To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the same suffix. For example,loadingandbeingare stored as showed in Figure 1....原创 2020-05-14 19:57:05 · 38963 阅读 · 0 评论 -
经典迪杰斯特拉算法
参数说明:n,城市的数量 m,边的数量 maxint,认为定义的一个认为是断路的标志 maxnum一个宏 dist[]纪录其他个点到出发点的距离,程序没有把算法写成函数,而是最简单的流水线执行,以0号城市为出发点 prev[] 纪录到某个点的前驱结点,通过遍历prev可以找到最短路径的路线 set[]纪录每个点是否被利用 迪杰斯特拉算法的思路主要包括两步找到未利用点中最近的一个点 进行松弛操作 经常会犯的错误: 多重循环中,循环变量比如i,j,k使用混...原创 2020-05-12 17:08:14 · 39050 阅读 · 0 评论 -
PAT-1015 Reversible Primes【进制转换】【素数判定】
Areversible primein any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a reversible prime because its reverse 37 is also a prime.Now given any two positive integersN(<105)...原创 2020-05-10 19:55:29 · 38842 阅读 · 0 评论 -
PAT-A-1031 Hello World for U 【简单模拟】
Given any string ofN(≥5) characters, you are asked to form the characters into the shape ofU. For example,helloworldcan be printed as:h de ll rlowoThat is, the characters must be printed in the original order, starting top-down from the le...原创 2020-05-22 07:30:55 · 38310 阅读 · 0 评论 -
PAT-A1018 Public Bike Management【Dijkstra算法】【DFS】
There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any station and return it to any other stations in the ...原创 2020-04-30 10:33:54 · 38648 阅读 · 0 评论 -
PAT-A-1076 Forwards on Weibo
Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social network is formed with followers relations. When a user makes a post on Weibo, all his/her followers can vi原创 2020-06-19 17:24:57 · 241 阅读 · 0 评论 -
PAT-A-1006 Sign In and Sign Out【简单模拟】
At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of signing in's and out's, you...原创 2020-05-05 19:56:12 · 38839 阅读 · 0 评论 -
PAT - A1047 Student List for Course【Map的使用】
Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses.Input Specification:Each input file contains one test case. F原创 2020-05-16 19:55:35 · 38785 阅读 · 0 评论 -
PAT-A1004 Counting Leaves 【DFS】
A family hierarchy(层次) is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contains one test case. Each case st...原创 2020-04-29 18:28:29 · 38695 阅读 · 0 评论 -
PAT-A- 1067 Sort with Swap(0, i)
Given any permutation of the numbers {0, 1, 2,...,N−1}, it is easy to sort them in increasing order. But what ifSwap(0, *)is the ONLY operation that is allowed to use? For example, to sort {4, 0, 2, 1, 3} we may apply the swap operations in the followin...原创 2020-05-31 11:55:32 · 34900 阅读 · 0 评论 -
PAT - A1013 Battle Over Cities 迪杰斯特拉求连通分量
It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we nee...原创 2020-04-29 21:30:06 · 38695 阅读 · 0 评论 -
PAT-A1103 Integer Factorization
TheK−Pfactorization of a positive integerNis to writeNas the sum of theP-th power ofKpositive integers. You are supposed to write a program to find theK−Pfactorization ofNfor any positive...原创 2020-04-30 10:44:30 · 38594 阅读 · 0 评论 -
PAT-A1041 Be Unique【散列】
Being unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: one bets on a number chosen from [1,104]. The first one who bets on a unique number wins. For example, if there are 7 peop原创 2020-05-13 20:30:09 · 38874 阅读 · 0 评论 -
PAT-A- 1092 To Buy or Not to Buy 【散列】
Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of beads. However the owner of the shop would only sell the strings in whole pieces. Hence Eva must check whet原创 2020-05-23 09:18:30 · 38814 阅读 · 0 评论 -
PAT A1001 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:Each input ...原创 2020-04-27 11:23:58 · 38732 阅读 · 0 评论 -
PAT-A- 1073 Scientific Notation 【科学计数法】
Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-][1-9].[0-9]+E[+-][0-9]+ which means that the integer portion has exactly one digit, there is at least one原创 2020-05-22 12:57:16 · 38302 阅读 · 0 评论 -
PAT-A-1052 Linked List Sorting
//着实被姥姥的测试用例惊叹到。A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integerkeyand aNextpointer to the next structure. Now given a linked list, you are supposed to s...原创 2020-05-16 18:44:09 · 38995 阅读 · 0 评论 -
PAT-A-1071 Speech Patterns 【散列】
People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "the cops". Analyzing such patterns can help to narrow down a speaker's identity, which is useful when validating, for exampl原创 2020-05-25 11:06:43 · 39019 阅读 · 0 评论 -
PAT-A-1084 Broken Keyboard 【散列】
On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters corresponding to those keys will not appear on screen.Now given a string that you are supposed to type, and the string that you actually type out, please原创 2020-05-22 17:37:10 · 38523 阅读 · 0 评论 -
PAT-A1070 Mooncake 贪心
Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region's culture. Now given the inventory amounts and the prices of all kinds原创 2020-05-17 21:53:46 · 38194 阅读 · 0 评论 -
PAT-A1021 Deepest Root【树】【树的深度】【DFS】
A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a highest tree. Such a root ...原创 2020-04-30 10:39:15 · 38699 阅读 · 0 评论 -
PAT A-1003 Emergency【无向图最短路】【Dijkstra算法】
As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered (零散的)cities connected by some roads. Amount of rescue teams in each city and ...原创 2020-04-27 23:00:08 · 38776 阅读 · 0 评论 -
PAT -A-1007 Maximum Subsequence Sum 简单动态规划
Given a sequence ofKintegers {N1,N2, ...,NK}. A continuous subsequence is defined to be {Ni,Ni+1, ...,Nj} where1≤i≤j≤K. The Maximum Subsequence is the continuous subsequen...原创 2020-05-04 20:20:32 · 38627 阅读 · 0 评论 -
PAT-A-1063 Set Similarity 【set】
Given two sets of integers, the similarity of the sets is defined to beNc/Nt×100%, whereNcis the number of distinct common numbers shared by the two sets, andNtis the total number of distinct numbers in the two sets. Your job is to calcula...原创 2020-05-26 10:16:08 · 67700 阅读 · 0 评论 -
PAT-A-1081 Rational Sum 【最大公约数】【最小公倍数】
GivenNrational numbers in the formnumerator/denominator, you are supposed to calculate their sum.Input Specification:Each input file contains one test case. Each case starts with a positive integerN(≤100), followed in the next lineNrational numb...原创 2020-05-23 09:18:05 · 38860 阅读 · 0 评论 -
PAT-A1035 Password【字符串处理】
To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish1(one) froml(Lin lowercase), or0(zero) fromO(oin uppercase). One ...原创 2020-05-20 21:35:25 · 38268 阅读 · 0 评论 -
PAT-A1058 A+B in Hogwarts【进制转换】【字符查找】
If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver Sickles to a Galleon and twenty-nine Knuts to a Sickle, it's easy enough." Your job is to write a program原创 2020-05-16 16:43:04 · 38924 阅读 · 0 评论 -
PAT-A1039 Course List for Student【Map的使用】
Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered course list for each student who comes for a query.Input Specification:Each input file cont原创 2020-05-13 22:12:42 · 38895 阅读 · 0 评论 -
PAT A1002 A+B for Polynomials 多项式相加
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 each line contain...原创 2020-04-27 10:16:23 · 38696 阅读 · 0 评论 -
PAT-A-1090 Highest Price in Supply Chain【树】
A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on the chain buys products from one's supplier in a pricePa..原创 2020-05-24 09:33:59 · 38863 阅读 · 0 评论 -
PAT-A-1072 Gas Station 【Dijkstra】
A gas station has to be built at such a location that the minimum distance between the station and any of the residential housing is as far away as possible. However it must guarantee that all the houses are in its service range.Now given the map of the原创 2020-06-01 10:39:13 · 35377 阅读 · 0 评论 -
PAT-A-1033 To Fill or Not to Fill 【贪心算法】
With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas stations on the way from time to time. Different gas station may give different price. You are asked to car原创 2020-05-24 14:44:46 · 38931 阅读 · 0 评论 -
PAT-1036 Boys vs Girls 最大值最小值
This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students.Input Specification:Each input file contains one test case. Each case contains a positive integerN, follo.原创 2020-05-12 21:58:50 · 38887 阅读 · 0 评论