随笔分类 -  训练赛

摘要:寻找两个有序数组的中位数 给定两个大小为 m 和 n 的有序数组 nums1 和 nums2。 请你找出这两个有序数组的中位数,并且要求算法的时间复杂度为 O(log(m + n))。 你可以假设 nums1 和 nums2 不会同时为空。 示例 1: nums1 = [1, 3]nums2 = [ 阅读全文
posted @ 2019-08-31 23:04 #忘乎所以# 阅读(560) 评论(0) 推荐(0)
摘要:1035 Password (20 分) 1035 Password (20 分) 1035 Password (20 分) To prepare for PAT, the judge sometimes has to generate random passwords for the users. 阅读全文
posted @ 2019-06-25 22:38 #忘乎所以# 阅读(119) 评论(0) 推荐(0)
摘要:1034 Head of a Gang (30 分) 1034 Head of a Gang (30 分) 1034 Head of a Gang (30 分) One way that the police finds the head of a gang is to check people's 阅读全文
posted @ 2019-06-25 11:44 #忘乎所以# 阅读(247) 评论(0) 推荐(0)
摘要:1033 To Fill or Not to Fill (25 分) 1033 To Fill or Not to Fill (25 分) 1033 To Fill or Not to Fill (25 分) With highways available, driving a car from H 阅读全文
posted @ 2019-06-24 17:00 #忘乎所以# 阅读(149) 评论(0) 推荐(0)
摘要:1032 Sharing (25 分) 1032 Sharing (25 分) 1032 Sharing (25 分) To store English words, one method is to use linked lists and store a word letter by lette 阅读全文
posted @ 2019-06-24 09:44 #忘乎所以# 阅读(142) 评论(0) 推荐(0)
摘要:1026 Table Tennis (30 分) 1026 Table Tennis (30 分) 1026 Table Tennis (30 分) A table tennis club has N tables available to the public. The tables are nu 阅读全文
posted @ 2019-06-23 14:24 #忘乎所以# 阅读(632) 评论(0) 推荐(0)
摘要:1029 Median (25 分) 1029 Median (25 分) 1029 Median (25 分) Given an increasing sequence S of N integers, the median is the number at the middle position 阅读全文
posted @ 2019-06-23 00:35 #忘乎所以# 阅读(245) 评论(0) 推荐(0)
摘要:1028 List Sorting (25 分) 1028 List Sorting (25 分) 1028 List Sorting (25 分) Excel can sort records according to any column. Now you are supposed to imi 阅读全文
posted @ 2019-06-23 00:33 #忘乎所以# 阅读(197) 评论(0) 推荐(0)
摘要:1027 Colors in Mars (20 分) 1027 Colors in Mars (20 分) 1027 Colors in Mars (20 分) People in Mars represent the colors in their computers in a similar w 阅读全文
posted @ 2019-06-22 23:50 #忘乎所以# 阅读(164) 评论(0) 推荐(0)
摘要:1025 PAT Ranking (25 分) 1025 PAT Ranking (25 分) 1025 PAT Ranking (25 分) Programming Ability Test (PAT) is organized by the College of Computer Science 阅读全文
posted @ 2019-06-19 10:33 #忘乎所以# 阅读(201) 评论(0) 推荐(0)
摘要:1024 Palindromic Number (25 分) 1024 Palindromic Number (25 分) 1024 Palindromic Number (25 分) A number that will be the same when it is written forward 阅读全文
posted @ 2019-06-19 08:56 #忘乎所以# 阅读(242) 评论(0) 推荐(0)
摘要:1023 Have Fun with Numbers (20 分) 1023 Have Fun with Numbers (20 分) 1023 Have Fun with Numbers (20 分) Notice that the number 123456789 is a 9-digit nu 阅读全文
posted @ 2019-06-19 00:58 #忘乎所以# 阅读(471) 评论(0) 推荐(0)
摘要:1022 Digital Library (30 分) 1022 Digital Library (30 分) 1022 Digital Library (30 分) A Digital Library contains millions of books, stored according to 阅读全文
posted @ 2019-06-19 00:38 #忘乎所以# 阅读(292) 评论(0) 推荐(0)
摘要:1021 Deepest Root (25 分) 1021 Deepest Root (25 分) 1021 Deepest Root (25 分) A graph which is connected and acyclic can be considered a tree. The height 阅读全文
posted @ 2019-06-18 23:53 #忘乎所以# 阅读(276) 评论(0) 推荐(0)
摘要:1020 Tree Traversals (25 分) 1020 Tree Traversals (25 分) 1020 Tree Traversals (25 分) Suppose that all the keys in a binary tree are distinct positive i 阅读全文
posted @ 2019-06-16 21:58 #忘乎所以# 阅读(345) 评论(0) 推荐(0)
摘要:1017 Queueing at Bank (25 分) 1017 Queueing at Bank (25 分) 1017 Queueing at Bank (25 分) Suppose a bank has K windows open for service. There is a yello 阅读全文
posted @ 2019-06-12 20:41 #忘乎所以# 阅读(276) 评论(0) 推荐(0)
摘要:1016 Phone Bills (25 分) 1016 Phone Bills (25 分) 1016 Phone Bills (25 分) A long-distance telephone company charges its customers by the following rules 阅读全文
posted @ 2019-06-12 17:47 #忘乎所以# 阅读(317) 评论(0) 推荐(0)
摘要:Problem A: Assignment AlgorithmTime limit: 1 sMemory limit: 512 MiBA low-budget airline is designing a sophisticated algorithm that will assign more d 阅读全文
posted @ 2019-04-08 16:35 #忘乎所以# 阅读(338) 评论(0) 推荐(0)
摘要:Anniversary party Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 20516 Accepted Submission(s): 7 阅读全文
posted @ 2019-04-03 21:37 #忘乎所以# 阅读(176) 评论(0) 推荐(0)
摘要:L2-002 链表去重 (25 分) 给定一个带整数键值的链表 L,你需要把其中绝对值重复的键值结点删掉。即对每个键值 K,只有第一个绝对值等于 K 的结点被保留。同时,所有被删除的结点须被保存在另一个链表上。例如给定 L 为 21→-15→-15→-7→15,你需要输出去重后的链表 21→-15→ 阅读全文
posted @ 2019-03-17 21:45 #忘乎所以# 阅读(347) 评论(0) 推荐(0)