随笔分类 -  PAT

摘要:题目描述 已知 n 个整数b1,b2,…,bn 以及一个整数 k(k<n)。 从 n 个整数中任选 k 个整数相加,可分别得到一系列的和。 例如当 n=4,k=3,4 个整数分别为 3,7,12,19 时,可得全部的组合与它们的和为: 3+7+12=22 3+7+19=29 7+12+19=38 3 阅读全文
posted @ 2018-08-06 18:58 深圳地铁Princess 阅读(375) 评论(1) 推荐(0)
摘要:Given two sets of integers, the similarity of the sets is defined to be N~c~/N~t~*100%, where N~c~ is the number of distinct common numbers shared by 阅读全文
posted @ 2018-08-02 19:43 深圳地铁Princess 阅读(175) 评论(0) 推荐(0)
摘要:问题 A: 简单计算器 题目描述 读入一个只包含 +, -, *, / 的非负整数计算表达式,计算该表达式的值。 读入一个只包含 +, -, *, / 的非负整数计算表达式,计算该表达式的值。 输入 测试输入包含若干测试用例,每个测试用例占一行,每行不超过200个字符,整数和运算符之间用一个空格分隔 阅读全文
posted @ 2018-07-30 19:41 深圳地铁Princess 阅读(655) 评论(0) 推荐(0)
摘要:Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1 = { 11, 12, 13, 14 } is 1 阅读全文
posted @ 2018-06-27 22:37 深圳地铁Princess 阅读(170) 评论(0) 推荐(0)
摘要:1049 Counting Ones (30)(30 分) The task is simple: given any positive integer N, you are supposed to count the total number of 1's in the decimal form 阅读全文
posted @ 2018-06-25 13:43 深圳地铁Princess 阅读(140) 评论(0) 推荐(0)
摘要:/********************** author: yomi date: 18.6.17 ps: 突然想到以序列合并代替快排,have a try! 这么想的原因是A1029 这种方法以O(n)的复杂度打败了我的快排O(nlogn) 然鹅,我忽视了一个问题,题目给的是递增序列,这是使用merge的前提条件。 我居然还以为我发现了又一排序算法。这么一想,归并... 阅读全文
posted @ 2018-06-19 15:23 深圳地铁Princess 阅读(131) 评论(0) 推荐(0)
摘要:1093 Count PAT's (25)(25 分) The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, a 阅读全文
posted @ 2018-06-17 14:51 深圳地铁Princess 阅读(150) 评论(0) 推荐(0)
摘要:1044 Shopping in Mars (25)(25 分) Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value ( 阅读全文
posted @ 2018-06-11 20:19 深圳地铁Princess 阅读(110) 评论(0) 推荐(0)
摘要:1010 Radix (25)(25 分) Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is "yes", if 6 is a dec 阅读全文
posted @ 2018-06-08 11:44 深圳地铁Princess 阅读(181) 评论(0) 推荐(0)
摘要:1038 Recover the Smallest Number (30)(30 分) Given a collection of number segments, you are supposed to recover the smallest number from them. For exam 阅读全文
posted @ 2018-05-27 16:23 深圳地铁Princess 阅读(152) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2018-05-07 11:45 深圳地铁Princess 阅读(2) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2018-05-07 11:41 深圳地铁Princess 阅读(2) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2018-05-06 09:19 深圳地铁Princess 阅读(2) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2018-04-15 16:09 深圳地铁Princess 阅读(1) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2018-04-11 18:26 深圳地铁Princess 阅读(1) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2018-04-11 16:36 深圳地铁Princess 阅读(1) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2018-03-22 18:55 深圳地铁Princess 阅读(0) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2018-03-01 21:51 深圳地铁Princess 阅读(5) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2018-03-01 19:23 深圳地铁Princess 阅读(1) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2018-02-27 20:04 深圳地铁Princess 阅读(1) 评论(0) 推荐(0)