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
<通信系统仿真原理与无线应用>中文版电子书,超星格式的,全书采用matlab仿真,很经典的教材。
上传时间: 2014-06-08
上传用户:a3318966
dsp 数字信号处理的c语言版本,非常不错,超星格式,效果不错
上传时间: 2013-12-13
上传用户:tonyshao
数据与计算机通信(第六版),电子工业出版社。中文PDF版,用超星打开
上传时间: 2016-02-11
上传用户:litianchu
The XML Toolbox converts MATLAB data types (such as double, char, struct, complex, sparse, logical) of any level of nesting to XML format and vice versa. For example, >> project.name = MyProject >> project.id = 1234 >> project.param.a = 3.1415 >> project.param.b = 42 becomes with str=xml_format(project, off ) "<project> <name>MyProject</name> <id>1234</id> <param> <a>3.1415</a> <b>42</b> </param> </project>" On the other hand, if an XML string XStr is given, this can be converted easily to a MATLAB data type or structure V with the command V=xml_parse(XStr).
标签: converts Toolbox complex logical
上传时间: 2016-02-12
上传用户:a673761058
Java Web应用程序设计,非常实用的电子书,请用超星浏览器打开学习
上传时间: 2014-01-24
上传用户:watch100
VC++图像处理程序设计,免费超星版的。
上传时间: 2014-11-07
上传用户:fredguo
MFC经典问答,免费超星版的,值得收藏。
上传时间: 2013-11-26
上传用户:lo25643
Visual C++编程实例教程(第一册),免费超星版的。
上传时间: 2013-12-17
上传用户:wangchong
Visual C++编程实例教程(第二册),免费超星版的。
上传时间: 2016-04-04
上传用户:fnhhs