臭咸鱼的缺氧瓶

快给我氧气!


  • Home

  • Tags

  • Categories

  • Archives

  • Search

PAT甲级1145Hashing - Average Search Time

Posted on 2020-08-07 | | Visitors:
Words count in article: 743 字 | Reading time ≈ 3 分
题目链接https://pintia.cn/problem-sets/994805342720868352/problems/994805343236767744 题解基础知识:哈希为做这道题,我简单复习了一下哈希(点击查看)。 题目要求往一个哈希表里插入n个正整数,然后从哈希表里查找m个正整数,请 ...
Read more »

数据结构-哈希

Posted on 2020-08-07 | | Visitors:
Words count in article: 1,452 字 | Reading time ≈ 5 分
背景散列(hash)是常见的算法思想之一,在很多程序中都会有意无意地使用到。 若给出$N$个正整数,再给出$M$个正整数,问这M个数中的每个数分别是否在$N$个数出现过,其中$N,M\leq10^5$,且所有正整数均不超过$10^5$。 对这个问题,最直接的思路是:对每个欲查询的正整数$x$,遍历$ ...
Read more »

PAT甲级1133Splitting A Linked List

Posted on 2020-08-07 | | Visitors:
Words count in article: 518 字 | Reading time ≈ 2 分
题目链接https://pintia.cn/problem-sets/994805342720868352/problems/994805346776760320 题解题目要求给1个有n(不超过1e5)个结点的单向链表和数字k(不超过1e3),链表的值属于[-1e5,1e5]要求将链表改为(或输出) ...
Read more »

PAT甲级1144The Missing Number

Posted on 2020-08-06 | | Visitors:
Words count in article: 320 字 | Reading time ≈ 1 分
题目链接https://pintia.cn/problem-sets/994805342720868352/problems/994805343463260160 题解题目要求给n(小于1e5)个int,找到最小的不在这些数字里的正整数 注意点 map未创建某元素时,如果直接访问,则其value是一 ...
Read more »

PAT甲级1132Cut Integer

Posted on 2020-08-06 | | Visitors:
Words count in article: 212 字 | Reading time ≈ 1 分
题目链接https://pintia.cn/problem-sets/994805342720868352/problems/994805347145859072 题解给n个k位(k为偶数)的整数z,将其分成a和b,判断z/(a*b)是不是一个整数即可 这里要注意a和b是否为0,这是个边界情况,如果 ...
Read more »

PAT甲级1148Werewolf - Simple Version

Posted on 2020-08-05 | | Visitors:
Words count in article: 502 字 | Reading time ≈ 2 分
题目链接https://pintia.cn/problem-sets/994805342720868352/problems/1038429808099098624 题解题目要求N(5到100)个玩家,其中2个狼人,只有1个狼人在撒谎(题目里说至少有1个狼人在撒谎但不是所有狼人都在撒谎……直接讲只有 ...
Read more »

PAT甲级1136A Delayed Palindrome

Posted on 2020-08-05 | | Visitors:
Words count in article: 698 字 | Reading time ≈ 3 分
题目链接https://pintia.cn/problem-sets/994805342720868352/problems/994805345732378624 题解一英语 notation 标记法 palindromic 回文的 palindrome 回文 be paired ...
Read more »

PAT甲级1140Look-and-say Sequence

Posted on 2020-08-04 | | Visitors:
Words count in article: 873 字 | Reading time ≈ 4 分
题目链接https://pintia.cn/problem-sets/994805342720868352/problems/994805344490864640 题解一英语 corresponding to 与…相一致,我之前似乎记成了“根据……” 思路、注意点和代码 题目:第n+1个数字 ...
Read more »

PAT甲级1152Google Recruitment

Posted on 2020-08-04 | | Visitors:
Words count in article: 510 字 | Reading time ≈ 2 分
题目链接https://pintia.cn/problem-sets/994805342720868352/problems/1071785055080476672 题解涉及到的英语知识 recruitment 招聘 the first 10-digit prime found in cons ...
Read more »

LeetCode230二叉搜索树中第K小的元素

Posted on 2020-08-01 | | Visitors:
Words count in article: 331 字 | Reading time ≈ 2 分
题目链接https://leetcode-cn.com/problems/kth-smallest-element-in-a-bst/ 题解 递归解法 根据BST的性质,中序遍历BST得到的结点序列为结点的升序序列,序列中第k个元素就是第k小的元素。 所以可以中序遍历BST生成升序序列,找到第k个元 ...
Read more »
1…121314…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
本站总访问量 次