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
本代码使用C语言,在linux环境下,用于实现aodv路由协议。
上传时间: 2013-12-17
上传用户:star_in_rain
本文档是一个说明文档,解释使用C语言在linux环境下用于实现aodv路由协议。
标签: 文档
上传时间: 2014-06-09
上传用户:561596
ns2网络仿真,无线协议仿真方面的,路由协议,mac协议
上传时间: 2014-09-08
上传用户:kikye
用游标的方法实现对称差的计算,即 (A-B)+(B-A)
上传时间: 2016-05-23
上传用户:远远ssad
NS系统中,aodv路由协议的源代码, 认真看懂以后,对这个路由协议的原理就理解的差不多了
标签:
上传时间: 2016-06-07
上传用户:hewenzhi
ns2.28中aodv的源代码,用于无线网络路由协议在ns中进行的仿真,NS_2的仿真模拟技术分析
上传时间: 2016-06-26
上传用户:daguda
词法分析器 对输入一个函数,并对其分析main() { int a,b a = 10 b = a + 20 }
上传时间: 2013-12-20
上传用户:hfmm633
学习传感器网络必须要看一看的文章,是对leach的后期版,集中式的分簇路由协议
标签: 传感器网络
上传时间: 2014-06-02
上传用户:
学习传感器网络必须要看一看的文章,是一个比较好的集中式的分簇路由协议
标签: 传感器网络
上传时间: 2016-07-29
上传用户:hakim