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
面试经典问题,想进中兴、华为大公司的请一定要下载奥
标签:
上传时间: 2014-01-13
上传用户:dongqiangqiang
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
Panorama系统程序开发规范,华为内部文件,供大家参考
上传时间: 2014-01-23
上传用户:qweqweqwe
Linux 操作指导专题 ,华为公司内部培训资料,内部公开。详细的linux操作指导,及相关命令详解
上传时间: 2014-01-25
上传用户:JIUSHICHEN
硬件工程师最好的入门材料和必备参考书,华为内参
上传时间: 2014-01-25
上传用户:zhliu007
C++笔试试试题集及分析。 包含西门子,IBM,华为等各知名企业的C语言笔试试题。
上传时间: 2016-05-26
上传用户:lunshaomo
做PCB板图的规范,有华为的经验总结,EMC设计方法以及一些NB人对布局布线的经验总结,都是很实用的东东,不过要想完全掌握那些N人的经验,可是需要很好的功底哦!
标签: PCB
上传时间: 2014-03-11
上传用户:zhangliming420
笔试问题,是华为一个项目经理选的一些C++笔试题目。
标签: 笔试
上传时间: 2014-01-12
上传用户:虫虫虫虫虫虫
在做印制板时,emc处理一直是一个让人头疼得问题,现上载个资料,可以作为参考。华为fpga设计规则
标签: 印制板
上传时间: 2014-01-07
上传用户:yan2267246