丧啊多
码龄6年
关注
提问 私信
  • 博客:15,222
    15,222
    总访问量
  • 43
    原创
  • 514,067
    排名
  • 8
    粉丝
  • 0
    铁粉

个人简介:ddd

IP属地以运营商信息为准,境内显示到省(区、市),境外显示到国家(地区)
IP 属地:上海市
  • 加入CSDN时间: 2018-10-21
博客简介:

weixin_43482621的博客

查看详细资料
个人成就
  • 获得9次点赞
  • 内容获得4次评论
  • 获得34次收藏
  • 代码片获得158次分享
创作历程
  • 1篇
    2021年
  • 42篇
    2019年
成就勋章
TA的专栏
  • pat甲级
    10篇
  • pta乙级
    7篇
  • 主题索引
    1篇
  • codeup习题集
    22篇
  • 算法笔记
    1篇
  • 程序设计与算法(三)
    1篇
兴趣领域 设置
  • 编程语言
    java
  • 大数据
    redis
  • 后端
    mysqlspringgolangspring boot架构
  • 搜索
    elasticsearch
  • 最近
  • 文章
  • 代码仓
  • 资源
  • 问答
  • 帖子
  • 视频
  • 课程
  • 关注/订阅/互动
  • 收藏
搜TA的内容
搜索 取消

2021春PAT甲级满分题解

orz:第一题素数筛+暴力 注意处理n==1的情况,第二题区间贪心,算法笔记上有原题,第三题水题,注意是逐个插入建树,所以是向上调整,第四题忘了floyd怎么写的,用的n遍dijkstra7-1 Arithmetic Progression of Primes (20 分)In mathematics, an arithmetic progression (AP,等差数列) is a sequence of numbers such that the difference between the con
原创
发布博客 2021.03.16 ·
1220 阅读 ·
3 点赞 ·
1 评论 ·
1 收藏

1008 数组元素循环右移问题 (20 分)

1008 数组元素循环右移问题 (20 分)一个数组A中存有N(>0)个整数,在不允许使用另外数组的前提下,将每个整数循环向右移M(≥0)个位置,即将A中的数据由(A​0A1​​ ⋯A​N−1)变换为(A​N−M ⋯A​N−1A​0A​1⋯A​N-M-1)(最后M个数循环移至最前面的M个位置)。如果需要考虑程序移动数据的次数尽量少,要如何设计移动的方法?输入格式:每个输入包含一个测试用...
原创
发布博客 2019.10.20 ·
411 阅读 ·
1 点赞 ·
0 评论 ·
1 收藏

1078 Hashing (25 分)

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 t...
原创
发布博客 2019.10.20 ·
199 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1015 Reversible Primes (20 分)

1015 Reversible Primes (20 分)A reversible prime in 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 becau...
原创
发布博客 2019.10.20 ·
156 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1063 Set Similarity (25 分)

1063 Set Similarity (25 分)Given two sets of integers, the similarity of the sets is defined to be N​c/N​t×100%, where N​c is the number of distinct common numbers shared by the two sets, and N​t is t...
原创
发布博客 2019.10.20 ·
154 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1104 Sum of Number Segments (20 分)

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 segmen...
原创
发布博客 2019.10.15 ·
127 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1039 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 cou...
原创
发布博客 2019.10.15 ·
95 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1047 Student List for Course (25 分)

1047 Student List for Course (25 分)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 nam...
原创
发布博客 2019.10.15 ·
100 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1007 素数对猜想 (20 分)

1007 素数对猜想 (20 分)让我们定义dn为:dn​​ =pn+1​​ −pn​​ ,其中pi是第i个素数。显然有d1 =1,且对于n>1有dn是偶数。“素数对猜想”认为“存在无穷多对相邻且差为2的素数”。现给定任意正整数N(<10​5),请计算不超过N的满足猜想的素数对的个数。输入格式:输入在一行给出正整数N。输出格式:在一行中输出不超过N的满足猜想的素数对的个数。...
原创
发布博客 2019.10.14 ·
225 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1049 数列的片段和 (20 分)

1049 数列的片段和 (20 分)给定一个正数数列,我们可以从中截取任意的连续的几个数,称为片段。例如,给定数列 { 0.1, 0.2, 0.3, 0.4 },我们有 (0.1) (0.1, 0.2) (0.1, 0.2, 0.3) (0.1, 0.2, 0.3, 0.4) (0.2) (0.2, 0.3) (0.2, 0.3, 0.4) (0.3) (0.3, 0.4) (0.4) 这 10...
原创
发布博客 2019.10.14 ·
103 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1069 The Black Hole of Numbers (20 分)

1069 The Black Hole of Numbers (20 分)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,...
原创
发布博客 2019.10.14 ·
110 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1019 数字黑洞 (20 分)

1019 数字黑洞 (20 分)给定任一个各位数字不完全相同的 4 位正整数,如果我们先把 4 个数字按非递增排序,再按非递减排序,然后用第 1 个数字减第 2 个数字,将得到一个新的数字。一直重复这样做,我们很快会停在有“数字黑洞”之称的 6174,这个神奇的数字也叫 Kaprekar 常数。例如,我们从6767开始,将得到7766 - 6677 = 10899810 - 0189 =...
原创
发布博客 2019.10.14 ·
120 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1003 我要通过!

1003 我要通过! (20 分)“答案正确”是自动判题系统给出的最令人欢喜的回复。本题属于 PAT 的“答案正确”大派送 —— 只要读入的字符串满足下列条件,系统就输出“答案正确”,否则输出“答案错误”。得到“答案正确”的条件是:字符串中必须仅有 P、 A、 T这三种字符,不可以包含其它字符;任意形如 xPATx 的字符串都可以获得“答案正确”,其中 x 或者是空字符串,或者是仅由字母...
原创
发布博客 2019.10.14 ·
106 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1049 Counting Ones (30 分)

1049 Counting Ones (30 分)The task is simple: given any positive integer N, you are supposed to count the total number of 1’s in the decimal form of the integers from 1 to N. For example, given N bein...
原创
发布博客 2019.10.13 ·
182 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1008 Elevator

1008 Elevator (20 分)The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified ...
原创
发布博客 2019.10.13 ·
176 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

codeup《算法笔记》题目索引(题目+答案+思路)

《算法笔记》2.1小节——C/C++快速入门->基本数据类型本小节无练习题orz《算法笔记》2.2小节——C/C++快速入门->顺序结构《算法笔记》5.1小节——数学问题->简单数学1939 Problem A 守形数1940 Problem B 反序数1957 Problem C 百鸡问题1958 Problem D abc1968 Proble...
原创
发布博客 2019.10.13 ·
2613 阅读 ·
2 点赞 ·
3 评论 ·
14 收藏

2125 Problem C Goldbach's Conjecture

问题 C: Goldbach’s Conjecture时间限制: 1 Sec 内存限制: 32 MB提交: 337 解决: 222题目描述Goldbach’s Conjecture: For any even number n greater than or equal to 4, there exists at least one pair of prime numbers p1 a...
原创
发布博客 2019.10.12 ·
213 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1946 Problem B Prime Number

问题 B: Prime Number时间限制: 1 Sec 内存限制: 32 MB提交: 633 解决: 273题目描述Output the k-th prime number.输入k≤10000输出The k-th prime number.样例输入1050样例输出29229思路简单题 打印素数表即可,注意要把maxn定义大一点 #include&l...
原创
发布博客 2019.10.12 ·
175 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1945 Problem A 素数

问题 A: 素数时间限制: 1 Sec 内存限制: 32 MB提交: 941 解决: 326题目描述输入一个整数n(2<=n<=10000),要求输出所有从1到这个整数之间(不包括1和这个整数)个位为1的素数,如果没有则输出-1。输入输入有多组数据。每组一行,输入n。输出输出所有从1到这个整数之间(不包括1和这个整数)个位为1的素数(素数之间用空格隔开,最后一个素...
原创
发布博客 2019.10.12 ·
174 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1997 Problem E 完数与盈数

问题 E: 完数与盈数时间限制: 1 Sec 内存限制: 32 MB提交: 174 解决: 161题目描述一个数如果恰好等于它的各因子(该数本身除外)子和,如:6=3+2+1,则称其为“完数”;若因子之和大于该数,则称其为“盈数”。求出2 到60 之间所有“完数”和“盈数”,并以如下形式输出: E: e1 e2 e3 …(ei 为完数) G: g1 g2 g3 …(gi 为盈数)...
原创
发布博客 2019.10.12 ·
198 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏
加载更多