![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构与算法
文章平均质量分 93
dmt_csr
前端菜鸟
展开
-
牛客网暑期ACM多校训练营(第一场) J题详解
牛客网J题在比赛时是通过率最高的一道题,但是这道题对于时间的复杂度要求比较高。在比赛的时候,很多队伍提交的程序都以”运行超时“而结束。那就让我们先来看看这道看似简单的题。Different Integers题目描述Given a sequence of integers a1, a2, ..., an and q pairs of integers (l1, r1), (l2, r2...原创 2018-07-20 16:15:02 · 1219 阅读 · 0 评论 -
浙大oj-2106 Tick and Tick
ProblemThe three hands of the clock are rotating every second and meeting each other many times everyday. Finally, they get bored of this and each of them would like to stay away from the other tw...原创 2019-03-07 22:41:11 · 153 阅读 · 0 评论 -
FatMouse' Trade ZOJ:2109
FatMouse' TradeTime Limit:2 Seconds Memory Limit:65536 KBFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean....原创 2019-05-27 10:29:45 · 81 阅读 · 0 评论 -
Gene Assembly ZOJ:1076
Gene AssemblyTime Limit:2 Seconds Memory Limit:65536 KBStatement of the ProblemWith the large amount of genomic DNA sequence data being made available, it is becoming more important to fi...原创 2019-05-27 10:32:03 · 120 阅读 · 0 评论 -
Subsequence ZOJ:3123
SubsequenceTime Limit:1 Second Memory Limit:32768 KBA sequence ofNpositive integers(10 < N < 100 000), each of them less than or equal10000, and a positive integerS (S < 100 0...原创 2019-05-27 10:40:37 · 100 阅读 · 0 评论 -
LeetCode -1两数之和
题目给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。你可以假设每种输入只会对应一个答案。但是,你不能重复利用这个数组中同样的元素。示例:给定 nums = [2, 7, 11, 15], target = 9因为 nums[0] + nums[1] = 2 + 7 = 9所以返回 [0, 1]func two...原创 2019-05-28 23:51:42 · 84 阅读 · 0 评论 -
LeetCode - 3无重复字符的最长子串
题目给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。示例 1:输入: “abcabcbb”输出: 3解释: 因为无重复字符的最长子串是 “abc”,所以其长度为 3。示例 2:输入: “bbbbb”输出: 1解释: 因为无重复字符的最长子串是 “b”,所以其长度为 1。示例 3:输入: “pwwkew”输出: 3解释: 因为无重复字符的最长子串是 “wke...原创 2019-05-28 23:53:57 · 80 阅读 · 0 评论 -
专业物理与数学2(第2讲——暴力求解法 | 除法)
学习目标整数、字串枚举方法排列生成递归方法下一个排列的枚举全排列方法会画解答树二进制回溯法的常见方法会使用STL例题1除法题目输入正整数n,按从小到大的顺序输出所有形如 abcde / fghij = n的表达式,其中a~j恰好为数字0~9的一个排列(可以有前导0),2≤n≤79。输入62输出79546 / 01283 = 6294736 / 0152...原创 2019-06-02 16:25:33 · 178 阅读 · 0 评论 -
数组操作JS(Set)
交集/** * @param {number[]} nums1 * @param {number[]} nums2 * @return {number[]} */const intersection = (nums1, nums2) => { return [...new Set(nums1)].filter(item => (new Set(nums2).has(it...原创 2019-07-14 22:07:35 · 836 阅读 · 0 评论