偶然原因开始了PAT之旅前前后后用了3天时间刷完了PAT Basic(35题)现在记录下从零单排的过程,总的来说题目很简单当然有个别题目的坑点还是比较给力的,准确的说,题目的数据很给力1001. 害死人不偿命的(3n+1)猜想 (15)纯模拟题,是偶数除以2,奇数(3n+1)除以2,到1结束#inc...
分类:
其他好文 时间:
2015-01-16 23:36:53
阅读次数:
329
pat是新加坡国立开发的工具,需要的去官网下http://www.comp.nus.edu.sg/~pat/,学了一天,是个不错的自动机验证工具,感觉还不错啊。验证一个数是否为斐波那契数且为质数方法先验证是否为斐波那契数,然后再判断质数代码/*验证是否为 斐波那契数且是质数*/#define go....
分类:
编程语言 时间:
2015-01-15 07:01:30
阅读次数:
270
PAT 2-07 素因子分解(C语言实现)PAT 2-07 素因子分解(C语言实现),有需要的朋友可以参考下。题目说明:给定某个正整数N,求其素因子分解结果,即给出其因式分解表达式 N = p1^k1* p2^k2*…*pm^km。输入格式说明:输入longint范围内的正整数N。输出格式说明:按给...
分类:
编程语言 时间:
2015-01-10 20:57:32
阅读次数:
177
Pat1089代码
题目描述:
According to Wikipedia:
Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element ...
分类:
其他好文 时间:
2015-01-10 01:31:42
阅读次数:
282
Pat1087代码
题目描述:
Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the most happiness.
Input S...
分类:
其他好文 时间:
2015-01-10 01:31:07
阅读次数:
245
Pat1090代码
题目描述:
A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.
Starting from one root supp...
分类:
其他好文 时间:
2015-01-10 01:28:52
阅读次数:
212
Pat1085代码
题目描述:
Given a sequence of positive integers and another positive integer p. The sequence is said to be a "perfect sequence" if M
Now given a sequence and a parameter p, you are s...
分类:
其他好文 时间:
2015-01-09 23:48:11
阅读次数:
495
Pat1086代码
题目描述:
An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered from 1 to 6...
分类:
其他好文 时间:
2015-01-09 23:45:43
阅读次数:
201
问题:有代价的单源最短路径,并要求存储路径。(求最短的路径,并使代价最小)特点:* 存储路径:决定了难以用dijkstra,可以用flody,用path[i][j]表示 i 想走到 j 迈出的第一步。假设k是 i->j 的中间节点,更新时候用path[i][j] = path[i][k],具体做法见link。但是flody比较耗时(O(N^3))* 有代价:如果想用flody的话,有要求代价最小,...
分类:
其他好文 时间:
2015-01-09 14:20:51
阅读次数:
191
Saving James Bond - Hard VersionThis time let us consider the situation in the movie "Live and Let Die" in which James Bond, the world's most famous s...
分类:
其他好文 时间:
2015-01-09 01:32:46
阅读次数:
311