- 博客(16)
- 资源 (11)
- 收藏
- 关注
原创 1009. 说反话 (20)
给定一句英语,要求你编写程序,将句中所有单词的顺序颠倒输出。输入格式:测试输入包含一个测试用例,在一行内给出总长度不超过80的字符串。字符串由若干单词和若干空格组成,其中单词是由英文字母(大小写有区分)组成的字符串,单词之间用1个空格分开,输入保证句子末尾没有多余的空格。输出格式:每个测试用例的输出占一行,输出倒序后的句子。输入样例: Hello World Here I Come 输出样例:
2017-09-03 13:34:58
286
原创 1017. A除以B (20)
本题要求计算A/B,其中A是不超过1000位的正整数,B是1位正整数。你需要输出商数Q和余数R,使得A = B * Q + R成立。输入格式:输入在1行中依次给出A和B,中间以1空格分隔。输出格式:在1行中依次输出Q和R,中间以1空格分隔。输入样例: 123456789050987654321 7 输出样例: 17636684150141093474 3a = input()k = a.sp
2017-09-03 13:32:47
274
原创 1021. 个位数统计 (15)
1021. 个位数统计 (15)给定一个k位整数N = dk-1*10k-1 + … + d1*101 + d0 (0<=di<=9, i=0,…,k-1, dk-1>0),请编写程序统计每种不同的个位数字出现的次数。例如:给定N = 100311,则有2个0,3个1,和1个3。输入格式:每个输入包含1个测试用例,即一个不超过1000位的正整数N。输出格式:对N中每一种不同的个位数字,以D:M的格式
2017-09-03 13:30:44
391
转载 机器学习和深度学习资料
比较全面的收集了机器学习的介绍文章,从感知机、神经网络、决策树、SVM、Adaboost到随机森林、Deep Learning。《机器学习经典论文/survey合集》介绍:看题目你已经知道了是什么内容,没错。里面有很多经典的机器学习论文值得仔细与反复的阅读。《Brief History of Machine Learning》2介绍:这是一篇介绍机器学习历史的文
2017-02-19 21:27:09
380
原创 5-1 List Components (10分)
For a given undirected graph with N vertices and E edges, please list all the connected components by both DFS (Depth First Search) and BFS (Breadth First Search). Assume that all the vertices are num
2016-12-14 13:42:29
1014
原创 最短路径问题(2)
承接上一篇博客,展示另一道PTA问题 4-2 Shortest Path [4] (25分) Write a program to find the weighted shortest distances from any vertex to a given source vertex in a digraph. If there is more than one mini
2016-11-25 09:48:54
710
原创 最短路径问题(1)
作为一名小白,最近学习了Dijkstra算法,对于最短路径的解有了一定的认识,从PTA的题目来说明Dijkstra算法4-1 Shortest Path [3] (25分) Write a program to not only find the weighted shortest distances, but also count the number of differen
2016-11-25 09:46:04
1942
原创 Topological Sort
Write a program to find the topological order in a digraph.Format of functions:bool TopSort( LGraph Graph, Vertex TopOrder[] );where LGraph is defined as the following:typedef struct AdjVNode
2016-11-18 16:21:58
854
原创 5-1 File Transfer (30分)
5-1 File Transfer (30分)We have a network of computers and a list of bi-directional connections. Each of these connections allows a file transfer from one computer to another. Is it possible to
2016-11-15 21:17:05
384
原创 4-1 Percolate Up and Down (20分)
4-1 Percolate Up and Down (20分)Write the routines to do a "percolate up" and a "percolate down" in a binary min-heap.Format of functions:void PercolateUp( int p, PriorityQueue H );void Pe
2016-11-11 12:42:21
1338
原创 树的深度
在学习数据结构树结构时,遇到求解树高度的问题,附上递归法求解树高度。typedef struct TNode *BinTree;struct TNode{ int Key; BinTree Left; BinTree Right;};int heightf(BinTree T){ int left = 0, right = 0; if(T -
2016-10-31 17:01:35
472
原创 5-1 Build A Binary Search Tree (30分)
5-1 Build A Binary Search Tree (30分)A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with ke
2016-10-28 16:56:51
1707
Machine Learning for Hackers
2017-08-31
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人