摘要: Eva is trying to make her own color stripe out of a given one. She would like to keep only her favorite colors in her favorite order by cutting off th 阅读全文
posted @ 2018-09-04 19:29 赖兴宇 阅读(278) 评论(0) 推荐(0) 编辑
摘要: When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A socia 阅读全文
posted @ 2018-09-04 17:03 赖兴宇 阅读(454) 评论(0) 推荐(0) 编辑
摘要: The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program t 阅读全文
posted @ 2018-09-04 15:55 赖兴宇 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Recommendation system predicts the preference that a user would give to an item. Now you are asked to program a very simple recommendation system that 阅读全文
posted @ 2018-09-03 22:38 赖兴宇 阅读(176) 评论(0) 推荐(0) 编辑
摘要: The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. 阅读全文
posted @ 2018-09-03 22:33 赖兴宇 阅读(210) 评论(0) 推荐(0) 编辑
摘要: With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas s 阅读全文
posted @ 2018-09-03 20:15 赖兴宇 阅读(200) 评论(0) 推荐(0) 编辑
摘要: Given a sequence of K integers { N​1​​, N​2​​, ..., N​K​​ }. A continuous subsequence is defined to be { N​i​​, N​i+1​​, ..., N​j​​ } where 1. The Max 阅读全文
posted @ 2018-09-03 15:31 赖兴宇 阅读(224) 评论(0) 推荐(0) 编辑
摘要: This time your job is to fill a sequence of N positive integers into a spiral matrix in non-increasing order. A spiral matrix is filled in from the fi 阅读全文
posted @ 2018-09-02 18:12 赖兴宇 阅读(248) 评论(0) 推荐(0) 编辑
摘要: Given any permutation of the numbers {0, 1, 2,..., N−1}, it is easy to sort them in increasing order. But what if Swap(0, *)is the ONLY operation that 阅读全文
posted @ 2018-09-02 18:06 赖兴宇 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic operations include Push ( 阅读全文
posted @ 2018-09-02 18:02 赖兴宇 阅读(137) 评论(0) 推荐(0) 编辑