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
我自己写的蚁群算法IDE,用到了管道技术,界面简单,实用。
上传时间: 2013-12-29
上传用户:520
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
自己写的一个数控加工程序中,剔除N行号的程序,简单,实用,用得着的朋友不妨看看!
上传时间: 2014-01-14
上传用户:rocketrevenge
读取fat分区表信息,,简单而实用,这是本人的第一个asm程序呢
上传时间: 2016-07-16
上传用户:zhichenglu
串口通讯编程,采用工作线程的方式或者串口的数据,程序简单但是实用。
上传时间: 2013-12-31
上传用户:顶得柱
介绍了几个用c语言编写的插值算法,程序简单,实用,很有帮助。
上传时间: 2016-09-27
上传用户:四只眼
WAP博客系统,简便简单,实用的。基本组成只有不到10个页面,初学者学习是非常好的。
上传时间: 2013-12-25
上传用户:liglechongchong
单片机与键盘接口程序,C代码,简单好实用。
上传时间: 2013-12-20
上传用户:litianchu
单片机与液晶屏接口程序,C代码,简单且实用。
上传时间: 2016-10-19
上传用户:lyy1234