随笔分类 - 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
阅读全文
摘要: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
阅读全文
摘要:问题 A: 简单计算器 题目描述 读入一个只包含 +, -, *, / 的非负整数计算表达式,计算该表达式的值。 读入一个只包含 +, -, *, / 的非负整数计算表达式,计算该表达式的值。 输入 测试输入包含若干测试用例,每个测试用例占一行,每行不超过200个字符,整数和运算符之间用一个空格分隔
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:/********************** author: yomi date: 18.6.17 ps: 突然想到以序列合并代替快排,have a try! 这么想的原因是A1029 这种方法以O(n)的复杂度打败了我的快排O(nlogn) 然鹅,我忽视了一个问题,题目给的是递增序列,这是使用merge的前提条件。 我居然还以为我发现了又一排序算法。这么一想,归并...
阅读全文
摘要: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
阅读全文
摘要: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 (
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
只有注册用户登录后才能阅读该文。
只有注册用户登录后才能阅读该文。

浙公网安备 33010602011771号