随笔分类 -  PAT乙级

PAT题解
摘要:原题 上图是用某科学研究中采集的数据绘制成的折线图,其中红色横线表示正常数据的阈值(在此图中阈值是 25)。你的任务就是把超出阈值的非正常数据所在的区间找出来。例如上图中横轴 [3, 5] 区间中的 3 个数据点超标,横轴上点 9 (可以表示为区间 [9, 9])对应的数据点也超标。 输入格式: 输 阅读全文
posted @ 2021-12-19 10:14 Infinite_V胜 阅读(51) 评论(0) 推荐(0)
摘要:原题 https://pintia.cn/problem-sets/994805260223102976/problems/994805275792359424 思路 1.刚开始我想的是两个循环。超时 2.发现每个数列相加的总个数是有规律的。比如0.1 0.2 0.3 0.4——》4*1次 3*2次 阅读全文
posted @ 2021-12-18 23:39 Infinite_V胜 阅读(36) 评论(0) 推荐(0)
摘要:原题 https://pintia.cn/problem-sets/994805260223102976/problems/1038429484026175488 知识点 1、map和unordered_map的使用 https://blog.csdn.net/qq_21997625/article 阅读全文
posted @ 2021-12-17 00:10 Infinite_V胜 阅读(19) 评论(0) 推荐(0)
摘要:原题 https://pintia.cn/problem-sets/994805260223102976/problems/1071786104348536832 知识点 之前没用过<unordered_map>抄答案都有点费劲。https://blog.csdn.net/weixin_450038 阅读全文
posted @ 2021-12-16 21:21 Infinite_V胜 阅读(45) 评论(0) 推荐(0)
摘要:原题 https://pintia.cn/problem-sets/994805260223102976/problems/1071785884776722432 代码 #include <iostream> #include <string> using namespace std; int re 阅读全文
posted @ 2021-12-12 21:43 Infinite_V胜 阅读(19) 评论(0) 推荐(0)
摘要:原题 https://pintia.cn/problem-sets/994805260223102976/problems/1071785779399028736 代码 #include <iostream> using namespace std; int result[1000]={0}; in 阅读全文
posted @ 2021-12-12 21:08 Infinite_V胜 阅读(29) 评论(0) 推荐(0)
摘要:原题 https://pintia.cn/problem-sets/994805260223102976/problems/1071785664454127616 代码 #include <iostream> #include <algorithm> using namespace std; int 阅读全文
posted @ 2021-12-12 19:59 Infinite_V胜 阅读(21) 评论(0) 推荐(0)
摘要:原题 https://pintia.cn/problem-sets/994805260223102976/problems/994805278589960192 思路 主元比它前面的所有数都要大,比它后面的所有数都要小。 那么只要跟它前面的最大值和后面的最小值比,随着判断主元位置的移动,最大值和最小 阅读全文
posted @ 2021-12-12 18:32 Infinite_V胜 阅读(21) 评论(0) 推荐(0)
摘要:原题 https://pintia.cn/problem-sets/994805260223102976/problems/994805286714327040 思路 前面看的柳大佬的,伤脑筋,我以为要会插入排序和归并排序才能做出来,其实不用,了解原理就可以了。 说一下我与大佬稍微不同的地方。对归并 阅读全文
posted @ 2021-12-10 22:37 Infinite_V胜 阅读(30) 评论(0) 推荐(0)
摘要:原题 https://pintia.cn/problem-sets/994805260223102976/problems/994805287624491008 思路 注意点: 1、浮点错误——只要是除就有除0的情况。 2、判断正负 代码 抄的柳大佬的 #include <iostream> #in 阅读全文
posted @ 2021-12-09 15:22 Infinite_V胜 阅读(38) 评论(0) 推荐(0)
摘要:原题 https://pintia.cn/problem-sets/994805260223102976/problems/994805288530460672 代码 测试点2考察第1行输入的空白字符串。题目保证第2行输入的文字串非空。,不保证第1行。 从别人哪里看的,太坑了。getline允许st 阅读全文
posted @ 2021-12-03 22:51 Infinite_V胜 阅读(35) 评论(0) 推荐(0)
摘要:原题 https://pintia.cn/problem-sets/994805260223102976/problems/994805289432236032 代码 注意只有一位参赛者的情况, 1 1 2 又因为其所代表的学校的编号(从1开始连续编号),所以令max=result[1] #incl 阅读全文
posted @ 2021-12-03 19:35 Infinite_V胜 阅读(26) 评论(0) 推荐(0)
摘要:原题 https://pintia.cn/problem-sets/994805260223102976/problems/994805290334011392 代码 #include <algorithm> #include <iostream> using namespace std; cons 阅读全文
posted @ 2021-12-03 12:40 Infinite_V胜 阅读(68) 评论(0) 推荐(0)
摘要:原题 https://pintia.cn/problem-sets/994805260223102976/problems/994805291311284224 测试点1 3 1 1 1 1 测试点3 1 1 1 加上这里的测试点介绍https://www.bilibili.com/read/cv1 阅读全文
posted @ 2021-12-02 16:02 Infinite_V胜 阅读(165) 评论(0) 推荐(0)
摘要:原题 https://pintia.cn/problem-sets/994805260223102976/problems/994805293282607104 思路 注意点: 1、闭区间,生日可以等于"1814/09/06"和"2014/09/06" 2、有效生日个数为0时,只输出0 思路: 1、 阅读全文
posted @ 2021-11-30 19:31 Infinite_V胜 阅读(64) 评论(0) 推荐(0)
摘要:原题 https://pintia.cn/problem-sets/994805260223102976/problems/994805294251491328 代码 #include <iostream> #include <vector> using namespace std; vector< 阅读全文
posted @ 2021-11-30 12:09 Infinite_V胜 阅读(32) 评论(0) 推荐(0)
摘要:原题 https://pintia.cn/problem-sets/994805260223102976/problems/994805295203598336 代码 #include <iostream> using namespace std; const int CLK_TCK=100; in 阅读全文
posted @ 2021-11-30 10:38 Infinite_V胜 阅读(23) 评论(0) 推荐(0)
摘要:原题 https://pintia.cn/problem-sets/994805260223102976/problems/994805268334886912 思路 也是参看的别人的代码。记录下三个要点。 1、输入的两个分数不是按大小排序,自已要判断一下 2、怎么判断分子和分母不能再约分? 这两个 阅读全文
posted @ 2021-11-29 18:35 Infinite_V胜 阅读(38) 评论(0) 推荐(0)
摘要:原题 https://pintia.cn/problem-sets/994805260223102976/problems/994805296180871168 代码 代码是看的别人的。https://www.cnblogs.com/siro/p/11129316.html 思路:用一个结构体数组来 阅读全文
posted @ 2021-11-29 12:30 Infinite_V胜 阅读(28) 评论(0) 推荐(0)
摘要:原题 https://pintia.cn/problem-sets/994805260223102976/problems/994805297229447168 java代码 注意把scanner换成BufferedReader不会超时 import java.io.BufferedReader; 阅读全文
posted @ 2021-11-25 20:48 Infinite_V胜 阅读(43) 评论(0) 推荐(0)