We have a group of N items (represented by integers from 1 to N), and we know that there is some total order defined for these items. You may assume that no two elements will be equal (for all a, b: a<b or b<a). However, it is expensive to compare two items. Your task is to make a number of comparisons, and then output the sorted order. The cost of determining if a < b is given by the bth integer of element a of costs (space delimited), which is the same as the ath integer of element b. Naturally, you will be judged on the total cost of the comparisons you make before outputting the sorted order. If your order is incorrect, you will receive a 0. Otherwise, your score will be opt/cost, where opt is the best cost anyone has achieved and cost is the total cost of the comparisons you make (so your score for a test case will be between 0 and 1). Your score for the problem will simply be the sum of your scores for the individual test cases.
标签: represented integers group items
上传时间: 2016-01-17
上传用户:jeffery
LL(1)语法分析器。 功能很点单,但是又算法分析。希望对你又用
上传时间: 2016-01-24
上传用户:zhouchang199
包括蚁群,模拟退火,遗传,神经网络,禁忌搜索等智能优化算法对TSP问题的解决。
标签:
上传时间: 2014-12-08
上传用户:小宝爱考拉
《人工神经网络导论》课程中的实验,实现奇偶校验的Matlab程序(BP算法)
上传时间: 2016-02-19
上传用户:66666
矩阵最短路径,算法分析中求最短路径的c++源程序代码
上传时间: 2016-02-26
上传用户:685
一个蚁群算方法的研究文章,很权威的。学习了很久,在现代智能优化算法中很重要
标签: 法的研究
上传时间: 2013-12-09
上传用户:mpquest
以八数码问题为例,设计一类滑块问题的求解系统,初步掌握智能搜索算法中的盲目搜索和启发式搜索这两类基本方法,同时通过具体的问题体会搜索算法、数据结构、程序设计等知识的综合应用。
标签: 数码
上传时间: 2016-03-21
上传用户:13681659100
用游标的方法实现对称差的计算,即 (A-B)+(B-A)
上传时间: 2016-05-23
上传用户:远远ssad
ACM一道合唱队形排列问题,也是算法分析里面的一道常出的题目,就是如何对合唱队形进行排列
标签: ACM
上传时间: 2016-06-01
上传用户:hanli8870
ACM里面一道题目,Gone Fishing,也是算法分析研究的题型,就是如何在各个钓鱼点进行排列,然后可以获得最多的鱼
标签: ACM
上传时间: 2016-06-01
上传用户:520