自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(12)
  • 收藏
  • 关注

原创 最长回文子串(中心扩展 c++)

自己敲的代码#include<cstdio>#include<string>#include<iostream>#include<algorithm>using namespace std;int change(string str, int i, int j) { // (1)i == st, j == st; // (2) i ...

2019-10-09 21:52:35 217

原创 【Leetcode】2. 两数相加

第一次标注Leetcode从今天开始, 以后就开始标注leetcode了, 刷了三个月左右的PTA,不过还没刷完, 但是《算法笔记》和《上机指南》差不多刷完了。PTA剩下的题目, 之后会慢慢来完成。刚开始刷leetcode, 不同的环境和测试方式,有很多不熟悉的地方, 比如这一题两数相加, 其中, c++ 构造函数, 很久没有, PTA里面, 多是用 #include头解题, 没有遇到过这类...

2019-10-08 08:16:01 113

原创 1030 Travel Plan (30 分) //Dijkstra练习

题干A traveler’s map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to decide the shortest pat...

2019-09-27 19:26:48 176 1

原创 1034 Head of a Gang (30 分)

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

2019-09-26 17:22:33 113 1

原创 PTA1064 A Complete Binary Search Tree (30 分)关于完美二叉排序树的实现练习

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

2019-09-21 22:10:36 116

原创 1056 Mice and Rice (25 分) queue的运用

1056 Mice and Rice (25 分)题干Mice and Rice is the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given map. The goal of each...

2019-09-18 09:46:05 122

原创 PTA A1039 Course List for Student (25 分)

1039 Course List for Student (25 分)题干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 ...

2019-09-15 11:24:02 113

原创 1023 Have Fun with Numbers (20 分)

1023 Have Fun with Numbers (20 分)题意Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 246913578, which hap...

2019-09-15 09:51:31 75

原创 1017 A除以B (20 分)

1017 A除以B (20 分)题意本题要求计算 A/B,其中 A 是不超过 1000 位的正整数,B 是 1 位正整数。你需要输出商数 Q 和余数 R,使得 A=B×Q+R 成立。输入格式:输入在一行中依次给出 A 和 B,中间以 1 空格分隔。输出格式:在一行中依次输出 Q 和 R,中间以 1 空格分隔。输入样例:123456789050987654321 7输出样例:1...

2019-09-14 13:23:15 77

原创 PTA A1101 Quick Sort (25 分)

PTA A1101 Quick Sort (25 分)题目There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then the elements less tha...

2019-09-13 15:23:03 175

原创 1085 Perfect Sequence (25 分)

1085 A 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×p where M and m are the maximum and minimum nu...

2019-09-12 17:13:53 53

原创 PTA 1067 Sort with Swap(0, i) (25 分)

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

2019-09-12 15:49:47 152

空空如也

空空如也

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

TA关注的人

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