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
模拟退火求解TSP旅行商问题,有全部的matlab源代码。并且有帮助文件。
上传时间: 2013-12-03
上传用户:huql11633
DOA估计(雷达来波方向估计)是雷达的重要理论,我提供了阵列信号处理中基于MUSIC算法的DOA估计,和基于最大熵法的DOA估计的MATLAB源代码。都是自己仿真用的。
上传时间: 2016-03-09
上传用户:zaizaibang
通信方面的基础算法,关于相空间分析,小波标架,时频分析等的一些matlab源代码
上传时间: 2016-03-27
上传用户:zyt
kalman滤波实验,目标轨迹跟踪,很好用的例子,供大家学习用
上传时间: 2013-12-21
上传用户:semi1981
计算3维系统分叉点,生成分叉图的MATLAB源代码。
上传时间: 2016-05-10
上传用户:从此走出阴霾
在电力系统中,用matlab源代码编写的基于pso算法优化程序
标签: 电力系统
上传时间: 2013-11-30
上传用户:电子世界
用游标的方法实现对称差的计算,即 (A-B)+(B-A)
上传时间: 2016-05-23
上传用户:远远ssad
维纳滤波器实现中值滤波,该程序是用matlab源代码来实现的。
上传时间: 2016-06-10
上传用户:www240697738
函数逼近BP神经网络,用matlab源代码编写,没有用工具箱!
上传时间: 2013-12-08
上传用户:zjf3110