01 2019 档案

摘要:https://leetcode.com/problems/reorganize-string/ Given a string S, check if the letters can be rearranged so that two characters that are adjacent to 阅读全文
posted @ 2019-01-31 09:50 _Zlrrr 阅读(169) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/minimum-index-sum-of-two-lists/ Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list 阅读全文
posted @ 2019-01-30 23:57 _Zlrrr 阅读(122) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/top-k-frequent-words/ Given a non-empty list of words, return the k most frequent elements. Your answer should be sorted 阅读全文
posted @ 2019-01-30 23:02 _Zlrrr 阅读(203) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/ Given a n x n matrix where each of the rows and columns are sorted in ascending 阅读全文
posted @ 2019-01-30 20:58 _Zlrrr 阅读(159) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/first-unique-character-in-a-string/ Given a string, find the first non-repeating character in it and return it's index. 阅读全文
posted @ 2019-01-30 20:35 _Zlrrr 阅读(97) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/sort-characters-by-frequency/ Given a string, sort it in decreasing order based on the frequency of characters. Example 阅读全文
posted @ 2019-01-30 20:31 _Zlrrr 阅读(106) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/sort-list/ Sort a linked list in O(n log n) time using constant space complexity. Example 1: Example 2: 代码: 归并排序 学到了 FHF 阅读全文
posted @ 2019-01-30 14:08 _Zlrrr 阅读(112) 评论(0) 推荐(0)
摘要:https://pintia.cn/problem-sets/994805342720868352/problems/994805345078067200 Suppose that all the keys in a binary tree are distinct positive integer 阅读全文
posted @ 2019-01-30 13:43 _Zlrrr 阅读(229) 评论(0) 推荐(0)
摘要:https://pintia.cn/problem-sets/994805342720868352/problems/994805344222429184 After each PAT, the PAT Center will announce the ranking of institutions 阅读全文
posted @ 2019-01-30 12:09 _Zlrrr 阅读(388) 评论(0) 推荐(0)
摘要:https://pintia.cn/problem-sets/994805342720868352/problems/994805343979159552 A clique is a subset of vertices of an undirected graph such that every 阅读全文
posted @ 2019-01-30 11:21 _Zlrrr 阅读(155) 评论(0) 推荐(0)
摘要:https://pintia.cn/problem-sets/994805342720868352/problems/994805343043829760 This is a problem given in the Graduate Entrance Exam in 2018: Which of 阅读全文
posted @ 2019-01-30 10:48 _Zlrrr 阅读(179) 评论(0) 推荐(0)
摘要:https://pintia.cn/problem-sets/994805342720868352/problems/994805343727501312 The lowest common ancestor (LCA) of two nodes U and V in a tree is the d 阅读全文
posted @ 2019-01-30 10:24 _Zlrrr 阅读(287) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/top-k-frequent-elements/ Given a non-empty array of integers, return the k most frequent elements. Example 1: Example 2: 阅读全文
posted @ 2019-01-29 22:25 _Zlrrr 阅读(144) 评论(0) 推荐(0)
摘要:https://ac.nowcoder.com/acm/contest/330#question A.Applese 的取石子游戏 #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; int N; int 阅读全文
posted @ 2019-01-29 20:43 _Zlrrr 阅读(368) 评论(0) 推荐(0)
摘要:https://pintia.cn/problem-sets/994805342720868352/problems/994805342821531648 In computer science, a heap is a specialized tree-based data structure t 阅读全文
posted @ 2019-01-29 20:27 _Zlrrr 阅读(104) 评论(0) 推荐(0)
摘要:https://pintia.cn/problem-sets/994805342720868352/problems/1038430013544464384 The "travelling salesman problem" asks the following question: "Given a 阅读全文
posted @ 2019-01-29 12:39 _Zlrrr 阅读(409) 评论(0) 推荐(0)
摘要:https://pintia.cn/problem-sets/994805342720868352/problems/1071785301894295552 A proper vertex coloring is a labeling of the graph's vertices with col 阅读全文
posted @ 2019-01-29 10:51 _Zlrrr 阅读(165) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/kth-largest-element-in-an-array/ Find the kth largest element in an unsorted array. Note that it is the kth largest elem 阅读全文
posted @ 2019-01-28 21:49 _Zlrrr 阅读(94) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/kth-largest-element-in-a-stream/ Design a class to find the kth largest element in a stream. Note that it is the kth lar 阅读全文
posted @ 2019-01-28 20:54 _Zlrrr 阅读(134) 评论(0) 推荐(0)
摘要:https://pintia.cn/problem-sets/994805342720868352/problems/1038430130011897856 The lowest common ancestor (LCA) of two nodes U and V in a tree is the 阅读全文
posted @ 2019-01-28 20:40 _Zlrrr 阅读(330) 评论(1) 推荐(0)
摘要:https://pintia.cn/problem-sets/994805342720868352/problems/1071785408849047552 In computer science, a heap is a specialized tree-based data structure 阅读全文
posted @ 2019-01-28 10:54 _Zlrrr 阅读(210) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/spiral-matrix-ii/ Given a positive integer n, generate a square matrix filled with elements from 1 to n2 in spiral order 阅读全文
posted @ 2019-01-27 14:28 _Zlrrr 阅读(104) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/spiral-matrix/ Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. 阅读全文
posted @ 2019-01-27 14:26 _Zlrrr 阅读(142) 评论(0) 推荐(0)
摘要:https://ac.nowcoder.com/acm/contest/327#question D.处女座与重修费 代码: #include <bits/stdc++.h> using namespace std; int N; int main() { scanf("%d", &N); int 阅读全文
posted @ 2019-01-24 22:04 _Zlrrr 阅读(235) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/lemonade-change/ At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you, and ord 阅读全文
posted @ 2019-01-22 12:16 _Zlrrr 阅读(205) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/assign-cookies/ Assume you are an awesome parent and want to give your children some cookies. But, you should give each 阅读全文
posted @ 2019-01-22 11:46 _Zlrrr 阅读(181) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/reverse-vowels-of-a-string/ Write a function that takes a string as input and reverse only the vowels of a string. Examp 阅读全文
posted @ 2019-01-21 22:55 _Zlrrr 阅读(172) 评论(0) 推荐(0)
摘要:https://pintia.cn/problem-sets/994805342720868352/problems/994805357933608960 On a broken keyboard, some of the keys are always stucked. So when you t 阅读全文
posted @ 2019-01-21 21:49 _Zlrrr 阅读(332) 评论(1) 推荐(0)
摘要:https://pintia.cn/problem-sets/994805342720868352/problems/994805357258326016 Given a set of N (>) positive integers, you are supposed to partition th 阅读全文
posted @ 2019-01-21 21:36 _Zlrrr 阅读(145) 评论(0) 推荐(0)
摘要:1.摆花问题 题目描述小明的花店新开张,为了吸引顾客,他想在花店的门口摆上一排花,共m盆。通过调查顾客的喜好,小明列出了顾客最喜欢的n种花,从1到n标号。为了在门口展出更多种花,规定第i种花不能超过ai盆,摆花时同一种花放在一起,且不同种类的花需按标号的从小到大的顺序依次摆列。试编程计算,一共有多少 阅读全文
posted @ 2019-01-21 10:45 _Zlrrr 阅读(463) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/design-linked-list/ Design your implementation of the linked list. You can choose to use the singly linked list or the d 阅读全文
posted @ 2019-01-20 22:01 _Zlrrr 阅读(195) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/linked-list-components/ We are given head, the head node of a linked list containing unique integer values. We are also 阅读全文
posted @ 2019-01-20 21:30 _Zlrrr 阅读(201) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/missing-number/ Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing fr 阅读全文
posted @ 2019-01-19 22:56 _Zlrrr 阅读(115) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/odd-even-linked-list/ Given a singly linked list, group all odd nodes together followed by the even nodes. Please note h 阅读全文
posted @ 2019-01-19 22:33 _Zlrrr 阅读(124) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/add-two-numbers-ii/ You are given two non-empty linked lists representing two non-negative integers. The most significan 阅读全文
posted @ 2019-01-19 21:14 _Zlrrr 阅读(189) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/reverse-linked-list/ Reverse a singly linked list. Example: Follow up: A linked list can be reversed either iteratively 阅读全文
posted @ 2019-01-19 17:21 _Zlrrr 阅读(105) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/ Given a sorted linked list, delete all nodes that have duplicate numbers, leaving 阅读全文
posted @ 2019-01-19 16:22 _Zlrrr 阅读(88) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/array-partition-i/ Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, 阅读全文
posted @ 2019-01-19 15:53 _Zlrrr 阅读(71) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/move-zeroes/ Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order 阅读全文
posted @ 2019-01-19 15:48 _Zlrrr 阅读(107) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/remove-nth-node-from-end-of-list/ Given a linked list, remove the n-th node from the end of list and return its head. Ex 阅读全文
posted @ 2019-01-19 15:33 _Zlrrr 阅读(127) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/swap-nodes-in-pairs/ Given a linked list, swap every two adjacent nodes and return its head. Example: Note: Your algorit 阅读全文
posted @ 2019-01-19 12:58 _Zlrrr 阅读(140) 评论(0) 推荐(0)
摘要:https://pintia.cn/problem-sets/994805342720868352/problems/994805348471259136 Recommendation system predicts the preference that a user would give to 阅读全文
posted @ 2019-01-19 12:09 _Zlrrr 阅读(221) 评论(0) 推荐(0)
摘要:https://pintia.cn/problem-sets/994805342720868352/problems/994805367987355648 A Binary Search Tree (BST) is recursively defined as a binary tree which 阅读全文
posted @ 2019-01-11 15:10 _Zlrrr 阅读(290) 评论(0) 推荐(0)
摘要:https://pintia.cn/problem-sets/994805342720868352/problems/994805383929905152 Given a list of N student records with name, ID and grade. You are suppo 阅读全文
posted @ 2019-01-11 14:22 _Zlrrr 阅读(291) 评论(0) 推荐(0)
摘要:https://pintia.cn/problem-sets/994805342720868352/problems/994805440976633856 A Binary Search Tree (BST) is recursively defined as a binary tree which 阅读全文
posted @ 2019-01-08 12:19 _Zlrrr 阅读(326) 评论(0) 推荐(0)
摘要:https://ac.nowcoder.com/acm/contest/301#question F.小乐乐下象棋 #include <cstdio> #include <cstring> #include <iostream> using namespace std; const long lon 阅读全文
posted @ 2019-01-04 22:21 _Zlrrr 阅读(158) 评论(0) 推荐(0)
摘要:https://ac.nowcoder.com/acm/contest/322#question A.dreamstart的催促 代码: #include <cstdio> #include <cstring> #include <iostream> using namespace std; con 阅读全文
posted @ 2019-01-04 12:42 _Zlrrr 阅读(234) 评论(0) 推荐(0)