摘要: 1019. General Palindromic Number A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example 阅读全文
posted @ 2016-08-03 23:11 zkang 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 1007. 素数对猜想 让我们定义 $d_n$ 为:$d_n = p_{n+1} p_n$,其中 pi 是第i个素数。显然有 d1=1 且对于n 1有 $d_n$ 是偶数。“素数对猜想”认为“存在无穷多对相邻且差为2的素数”。 现给定任意正整数$N ( include int isprime(int 阅读全文
posted @ 2016-08-03 21:11 zkang 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 1048. Find Coins Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shoppi 阅读全文
posted @ 2016-08-03 20:43 zkang 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 1037. Magic Coupon The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this c 阅读全文
posted @ 2016-08-03 20:39 zkang 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 1099. Build A Binary Search Tree A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtr 阅读全文
posted @ 2016-08-03 20:24 zkang 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 1085. Perfect Sequence Given a sequence of positive integers and another positive integer p. The sequence is said to be a "perfect sequence" if M incl 阅读全文
posted @ 2016-08-03 20:19 zkang 阅读(465) 评论(0) 推荐(0) 编辑
摘要: 1081. Rational Sum Given N rational numbers in the form "numerator/denominator", you are supposed to calculate their sum. Input Specification: Each in 阅读全文
posted @ 2016-08-03 20:16 zkang 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 1069. The Black Hole of Numbers For any 4 digit integer except the ones with all the digits being the same, if we sort the digits in non increasing or 阅读全文
posted @ 2016-08-03 20:11 zkang 阅读(6629) 评论(0) 推荐(0) 编辑
摘要: 1015. Reversible Primes A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the d 阅读全文
posted @ 2016-08-03 20:07 zkang 阅读(219) 评论(0) 推荐(0) 编辑
摘要: PAT B 1034. 有理数四则运算 本题要求编写程序,计算2个有理数的和、差、积、商。 输入格式: 输入在一行中按照“a1/b1 a2/b2”的格式给出两个分数形式的有理数,其中分子和分母全是整型范围内的整数,负号只可能出现在分子前,分母不为0。 输出格式: 分别在4行中按照“有理数1 运算符 阅读全文
posted @ 2016-08-03 12:23 zkang 阅读(295) 评论(0) 推荐(0) 编辑
摘要: 萌萌哒表情符号通常由“手”、“眼”、“口”三个主要部分组成。简单起见,我们假设一个表情符号是按下列格式输出的: 现给出可选用的符号集合,请你按用户的要求输出表情。 输入格式: 输入首先在前三行顺序对应给出手、眼、口的可选符号集。每个符号括在一对方括号[]内。题目保证每个集合都至少有一个符号,并不超过 阅读全文
posted @ 2016-08-03 11:57 zkang 阅读(1548) 评论(0) 推荐(0) 编辑