自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(66)
  • 资源 (1)
  • 收藏
  • 关注

原创 解决eclipse运行中出现的端口被占用问题

方法一步骤一:首先确定被占用的端口win+rcmd  找所有端口:netstat -ano找确定端口:netstat -ano|findstr 8080第二列最后几位为端口号  最后一列为pid 步骤二在任务管理器中找到该pid,结束process(发现是tomcat8.exe占用)成功解决~方法二步骤一:双击控制台server下的...

2018-09-29 12:48:11 7153

原创 ZCMU 1679: 查找2(upper_bound()函数)

Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 396  Solved: 139Description给你一个长度是n的序列A,然后,有m次询问,每次询问是一个数字X,请你告诉我X在序列A中有多少个数是不大于它的Input第一行 ,n,m,(n,m<=100000)第二行n个数(每个数<=1000)第三行m个数...

2018-09-13 16:55:24 211

原创 1989: Julyed(水)

Time Limit: 2 Sec  Memory Limit: 64 MBSubmit: 30  Solved: 28DescriptionJulyed is preparing for her CET-6. She has N words to remember, but there is only M days left. If she can’t remember all the...

2018-09-12 13:48:35 196

原创 ZCMU: 1821: 入学考试(dp背包)

Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 30  Solved: 24Description辰辰是个天资聪颖的孩子,他的梦想是成为世界上最伟大的医师。为此,他想拜附近最有威望的医师为师。医师为了判断他的资质,给他出了一个难题。医师把他带到一个到处都是草药的山洞里对他说:“孩子,这个山洞里有一些不同的草药,采每一株都需要一些时间,每一株也...

2018-09-11 20:00:58 142

原创 ZCMU 1620: 全排列

Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 242  Solved: 112Description给定n个数 a[0] , a[1] ........ a[n-1], 输出其全排列。 Input第一行输入一个数n,(n<7)接下来一行输入n个数。 Output按字典序从小到大输出全排列 Sampl...

2018-09-10 13:31:59 214

原创 灌溉 (图论+最小生成树+并查集)

到了旱季农业生产的灌溉就成了一个大问题。为了保证灌溉的顺利,某县政府决定投资为各个村之间建立灌溉管道。输入第1行包括一个整数N,表示某县的村庄的数量。(3≤N≤100),第2行-结尾为一个N×N的矩阵,表示每个村庄之间的距离。虽然在理论上,他们是N行,每行由N个用空格分隔的数组成,实际上,他们限制在80个字符,因此,某些行会紧接着另一些行。当然,对角线将会是0,因为不会有线路从第i个村到它本身...

2018-09-09 14:18:33 253

转载 PAT 1022 Digital Library(30 分)(字符串查找+vector+结构体)

A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigned an unique 7-digit number a...

2018-09-05 18:42:41 130

原创 #include<string>下的str.find()函数

str.find(ss)//返回字符串ss在str中的位置str.find(ss,num) //在str[num]~str[n-1]范围内查找并返回字符串ss在str的位置str.rfind(ss,num)////在str[0]~str[num]范围内查找并返回字符串ss在str的位置(reverse)例子:#include &lt;iostream&gt;using name...

2018-09-05 16:53:51 5602 1

原创 ZCMU 4941: 继续畅通工程(最小生成树+并查集+Kruskal算法)

Time Limit: 1 Sec  Memory Limit: 32 MBSubmit: 3  Solved: 3Description省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。现得到城镇道路统计表,表中列出了任意两城镇间修建道路的费用,以及该道路是否已经修通的状态。现请你编写程序,计算出全省畅通需要的最低...

2018-09-05 14:00:19 186

原创 ZCMU 4926: 还是畅通工程(最小生成树+并查集)

Time Limit: 1 Sec  Memory Limit: 32 MBSubmit: 5  Solved: 4Description        某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度...

2018-09-04 13:56:49 164

原创 PAT 1133 Splitting A Linked List(25 分)(结构体+链表)

Given a singly linked list, you are supposed to rearrange its elements so that all the negative values appear before all of the non-negatives, and all the values in [0, K] appear before all those grea...

2018-09-04 13:27:59 151

原创 PAT 1132 Cut Integer(20 分)(字符串)

Cutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits long integers A and B. For example, after cutting Z = 167334, we have A = 167 and B = 334. It is interesting...

2018-09-04 13:27:45 141

原创 PAT 1035 Password(20 分)(字符串+switch case + vector)

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 distinguish 1 (one) from l (L ...

2018-09-04 13:27:18 117

原创 PAT 1145 Hashing - Average Search Time(25 分)(哈希+平均查找时间)

The task of this problem is simple: insert a sequence of distinct positive integers into a hash table first. Then try to find another sequence of integer keys from the table and output the average sea...

2018-09-04 13:27:08 227

原创 PAT 1013 Battle Over Cities(25 分)(dfs)

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...

2018-09-04 13:26:50 104

原创 PAT 1046 Shortest Distance(20 分)(简单数组)

The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits.Input Specification:Each input file conta...

2018-09-03 10:11:48 127

原创 HDU 1232:畅通工程(连通分量+并查集)

Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 69579    Accepted Submission(s): 37236Problem Description某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接...

2018-09-02 15:25:23 103

原创 PAT 1041 Be Unique(20 分)(哈希)

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,10​4​​]. The first one who bets o...

2018-09-01 14:39:38 160

原创 PAT 1065 A+B and C (64bit)(20 分)(整数溢出)

Given three integers A, B and C in [−2​63​​,2​63​​], you are supposed to tell whether A+B&gt;C.Input Specification:The first line of the input gives the positive number of test cases, T (≤10). The...

2018-09-01 14:35:54 158

原创 PAT 1069 The Black Hole of Numbers(20 分)(do while循环)

For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decreasing order, a new number can be obtained by takin...

2018-09-01 14:21:42 77

原创 PAT 1028 List Sorting(25 分)(排序)

Excel can sort records according to any column. Now you are supposed to imitate this function.Input Specification:Each input file contains one test case. For each case, the first line contains two...

2018-09-01 14:19:17 107

原创 PAT 1146 Topological Order(25 分)(拓扑排序)

This is a problem given in the Graduate Entrance Exam in 2018: Which of the following is NOT a topological order obtained from the given directed graph? Now you are supposed to write a program to test...

2018-09-01 13:17:09 164

原创 PAT 1019 General Palindromic Number(20 分)(进制转换+回文)

A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number. All single digit numbers are palindromic numbers...

2018-08-31 13:18:39 139

原创 PAT 1077 Kuchiguse(20 分)(reverse()函数)

The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker's personality. Such a preference is called ...

2018-08-31 13:12:47 158

原创 PAT 1062 Talent and Virtue(25 分)(vector+排序)

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 virt...

2018-08-31 12:55:38 80

原创 PAT 1012 The Best Rank(25 分)(排序)

To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (Calculus or Linear Algrbra), and E - Eng...

2018-08-31 11:24:57 343

原创 PAT 1025 PAT Ranking(25 分)(排序+排名)

1025 PAT Ranking(25 分)Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in several pla...

2018-08-31 11:20:35 1201

原创 PAT 1037 Magic Coupon(25 分)(贪心)

The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a product, you may get N times the value of that product b...

2018-08-31 11:16:10 230

原创 PAT 1067 Sort with Swap(0, i)(25 分)(用指定方法排序)

Given any permutation of the numbers {0, 1, 2,..., N−1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation that is allowed to use? For example, to sort {4, 0, 2...

2018-08-31 11:07:39 246

原创 PAT 1038 Recover the Smallest Number(30 分)(头文件#include<string>)

Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given { 32, 321, 3214, 0229, 87 }, we can recover many numbers such like 32-321-3214-0229...

2018-08-31 11:01:47 87

原创 PAT 1085 Perfect Sequence(25 分)(二分)

Given a sequence of positive integers and another positive integer p. The sequence is said to be a perfect sequence if M≤m×pwhere M and m are the maximum and minimum numbers in the sequence, respectiv...

2018-08-31 10:56:52 203

原创 PAT 1104 Sum of Number Segments(20 分)(数学规律)

Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2, 0.3, 0.4 }, we have 10 segments: (0.1) (0.1, 0.2) (0.1, 0.2, 0.3...

2018-08-31 10:49:19 83

原创 PAT 1078 Hashing(25 分)(哈希+平方探测法)

The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. The hash function is defined to be H(key)=key%TSiz...

2018-08-30 19:17:59 388

原创 PAT 1064 Complete Binary Search Tree(30 分)(完全二叉排序树)

A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less than the node's key. The right su...

2018-08-30 19:04:53 97

原创 Dogs and Cages(数学 排列)

Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d &amp; %I64uDescriptionJerry likes dogs. He has $N$ dogs numbered $0, 1, ..., N-1$. He also has $N$ cages numbered $0, 1, ..., N...

2018-08-30 19:00:09 173

原创 练习集 L2-027 名人堂与代金券(25 分)(排序+排名)

对于在中国大学MOOC(http://www.icourse163.org/)学习“数据结构”课程的学生,想要获得一张合格证书,总评成绩必须达到 60 分及以上,并且有另加福利:总评分在 [G, 100] 区间内者,可以得到 50 元 PAT 代金券;在 [60, G) 区间内者,可以得到 20 元PAT代金券。全国考点通用,一年有效。同时任课老师还会把总评成绩前 K 名的学生列入课程“名人堂”。...

2018-08-30 18:55:58 130

原创 PAT 1083 List Grades(25 分)(排序)

Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grades ...

2018-08-29 19:49:49 141

原创 PAT 1033 To Fill or Not to Fill(25 分)(贪心)

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 ga...

2018-08-29 15:50:40 136

原创 ZCMU 4942: 计算两个矩阵的乘积

Time Limit: 1 Sec  Memory Limit: 32 MBSubmit: 8  Solved: 4 Description计算两个矩阵的乘积,第一个是2*3矩阵,第二个是3*2矩阵,结果为一个2*2矩阵。Input输入包含多组数据,先输入一个2*3矩阵,再输入一个3*2矩阵。Output输出两个矩阵的乘积。Sample Input1 1 1 1...

2018-08-29 15:38:47 896

原创 ZCMU 4929: 连通图(DFS+判断是否连通)

Time Limit: 1 Sec  Memory Limit: 32 MBSubmit: 3  Solved: 3Description给定一个无向图和其中的所有边,判断这个图是否所有顶点都是连通的。Input每组数据的第一行是两个整数 n 和 m(0&lt;=n&lt;=1000)。n 表示图的顶点数目,m 表示图中边的数目。如果 n 为 0 表示输入结束。随后有 m 行数据...

2018-08-29 15:36:36 711 3

编程之禅pdf

编程之禅

2018-11-16

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除