臭咸鱼的缺氧瓶

快给我氧气!


  • Home

  • Tags

  • Categories

  • Archives

  • Search

PAT乙级1032

Posted on 2019-08-08 | | Visitors:
Words count in article: 351 字 | Reading time ≈ 2 分
题目链接https://pintia.cn/problem-sets/994805260223102976/problems/994805289432236032 题解用数组的下标表示学校,数组元素表示分数。统计各校分数后,遍历求最大就好了。 做这道题遇到一个memset初始化数组元素的问题,具体见 ...
Read more »

memset初始化数组的坑

Posted on 2019-08-08 | | Visitors:
Words count in article: 430 字 | Reading time ≈ 2 分
memset函数常被我们用来初始化数组,然而有个坑可能会被我们踩到。 静态数组初始化一般情形是这样的: 12345678910111213141516#include <cstring>int main(){ // 静态数组arr int arr[10]; ...
Read more »

PAT乙级1031

Posted on 2019-08-07 | | Visitors:
Words count in article: 406 字 | Reading time ≈ 2 分
题目链接https://pintia.cn/problem-sets/994805260223102976/problems/994805290334011392 题解emmm。对于每个身份证号,判断前17位是否合法,并计算其与对应权重积之和,最后判断校验位是否合法。 123456789101112 ...
Read more »

PAT乙级1030

Posted on 2019-08-07 | | Visitors:
Words count in article: 389 字 | Reading time ≈ 2 分
题目链接https://pintia.cn/problem-sets/994805260223102976/problems/994805292322111488 题解emm刚开始思路有点错误,我直接将从小到大排序后的数列首个元素作为数列的最小值,但其实不是,数列第一个元素的不同可能会导致更大的完美 ...
Read more »

PAT乙级1029

Posted on 2019-08-07 | | Visitors:
Words count in article: 280 字 | Reading time ≈ 1 分
题目链接https://pintia.cn/problem-sets/994805260223102976/problems/994805292322111488 题解思路: 可以想到,没有坏键的话就是两个字符串是一样的。所以我们按下标进行比较,发现不一样的就是坏掉的,然后在错误字符串的该位置添加一 ...
Read more »

PAT乙级1028

Posted on 2019-08-07 | | Visitors:
Words count in article: 377 字 | Reading time ≈ 2 分
题目链接https://pintia.cn/problem-sets/994805260223102976/problems/994805293282607104 题解这题跟那个德才论(PAT乙级1015)什么的差不多。 因为我用了string和algorithm,所以整个代码实现比较简单。 值得注 ...
Read more »

PAT乙级1027

Posted on 2019-08-07 | | Visitors:
Words count in article: 388 字 | Reading time ≈ 2 分
题目链接https://pintia.cn/problem-sets/994805260223102976/problems/994805294251491328 题解主要有两个内容: 获取第一行(最长行)字符的个数。这个与一般的菱形打印不同,该题的字符不一定用完。 通过循环输出空格与字符(末尾空 ...
Read more »

PAT乙级1026

Posted on 2019-08-07 | | Visitors:
Words count in article: 191 字 | Reading time ≈ 1 分
题目链接https://pintia.cn/problem-sets/994805260223102976/problems/994805295203598336 题解就只有一个四舍五入需要注意一下,其他的没啥难度,都是简单的运算而已…… 123456789101112131415161718192 ...
Read more »

PAT乙级1025

Posted on 2019-08-06 | | Visitors:
Words count in article: 541 字 | Reading time ≈ 3 分
题目链接https://pintia.cn/problem-sets/994805260223102976/problems/994805296180871168 题解第一遍没有全部AC,最后1个测试点没过,原因是题目给的结点中有可能有无效结点,所以需要重新统计结点个数。(参考链接:https:// ...
Read more »

PAT乙级1024

Posted on 2019-08-06 | | Visitors:
Words count in article: 520 字 | Reading time ≈ 2 分
题目链接https://pintia.cn/problem-sets/994805260223102976/problems/994805297229447168 题解第一遍也是没有全部AC,有3个测试点没过,原因如下: 没有处理指数为0的情况 指数为正时,没有处理不需补充0而需插入小数点的情况。 ...
Read more »
1…202122…32
臭咸鱼

臭咸鱼

祝你天天开心啊!

316 posts
182 tags
RSS
Links
  • Road Wide's Blog
  • Chou Xianyu's CNBlog
© 2018 — 2021 臭咸鱼 | Site words total count: 289.4k
Powered by Hexo
|
Theme — NexT.Gemini v5.1.4
本站总访问量 次