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
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
单片机开发仪态网通讯用的用的TCP/IP程序包,C语言代码
上传时间: 2016-02-25
上传用户:ryb
矩阵最短路径,算法分析中求最短路径的c++源程序代码
上传时间: 2016-02-26
上传用户:685
这是用proteus和keil两个平台一起完成的,对学习嵌入式的人来说绝对超值,提供了汇编和c语言代码
上传时间: 2016-03-04
上传用户:chenxichenyue
这是用proteus和keil两个平台一起完成的,对学习嵌入式的人来说绝对超值,提供了汇编和c语言代码,希望对那些没有开发板而希望学习的带来福音
上传时间: 2016-03-04
上传用户:evil
AT24C02的读写,连续读连续写程序,为c语言代码,经过实际应用的程序
上传时间: 2014-01-21
上传用户:ynsnjs
DES 加密算法,详细的C语言代码 帮助你快速开发 自己的加密软件
上传时间: 2016-03-22
上传用户:lhw888
BF5xx DSP处理器摄像头接口电路图,与我上传的C语言代码配合使用
上传时间: 2014-07-26
上传用户:xinyuzhiqiwuwu
电力系统潮流计算的程序,用C语言代码编写的
上传时间: 2016-05-19
上传用户:pinksun9