随笔分类 - 训练赛
摘要:寻找两个有序数组的中位数 给定两个大小为 m 和 n 的有序数组 nums1 和 nums2。 请你找出这两个有序数组的中位数,并且要求算法的时间复杂度为 O(log(m + n))。 你可以假设 nums1 和 nums2 不会同时为空。 示例 1: nums1 = [1, 3]nums2 = [
阅读全文
摘要:1035 Password (20 分) 1035 Password (20 分) 1035 Password (20 分) To prepare for PAT, the judge sometimes has to generate random passwords for the users.
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:1025 PAT Ranking (25 分) 1025 PAT Ranking (25 分) 1025 PAT Ranking (25 分) Programming Ability Test (PAT) is organized by the College of Computer Science
阅读全文
摘要:1024 Palindromic Number (25 分) 1024 Palindromic Number (25 分) 1024 Palindromic Number (25 分) A number that will be the same when it is written forward
阅读全文
摘要: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
阅读全文
摘要:1022 Digital Library (30 分) 1022 Digital Library (30 分) 1022 Digital Library (30 分) A Digital Library contains millions of books, stored according to
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:1016 Phone Bills (25 分) 1016 Phone Bills (25 分) 1016 Phone Bills (25 分) A long-distance telephone company charges its customers by the following rules
阅读全文
摘要:Problem A: Assignment AlgorithmTime limit: 1 sMemory limit: 512 MiBA low-budget airline is designing a sophisticated algorithm that will assign more d
阅读全文
摘要:Anniversary party Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 20516 Accepted Submission(s): 7
阅读全文
摘要:L2-002 链表去重 (25 分) 给定一个带整数键值的链表 L,你需要把其中绝对值重复的键值结点删掉。即对每个键值 K,只有第一个绝对值等于 K 的结点被保留。同时,所有被删除的结点须被保存在另一个链表上。例如给定 L 为 21→-15→-15→-7→15,你需要输出去重后的链表 21→-15→
阅读全文

浙公网安备 33010602011771号