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
基于mc908GR60的LIN通信例程,采用volcano提供的gr60函数库实现。具有主站和从站双重功能,可在codewarrior3.1以及以上版本中的项目设置里切换。函数库可以用于其它gr60的工程
上传时间: 2016-02-14
上传用户:qq521
基于mc908gz60的LIN通信例程,采用volcano提供的gz60函数库,包含主站通信函数以及从站通信函数。此函数库可用于其他gz60系统。需用codewarrior3.1或以上版本编译
上传时间: 2016-02-14
上传用户:84425894
SP联通短信平台所有程序,包含主站程序,发送接收,群发,后台处理,web
上传时间: 2013-12-26
上传用户:jing911003
用游标的方法实现对称差的计算,即 (A-B)+(B-A)
上传时间: 2016-05-23
上传用户:远远ssad
此程序适用于电力系统中的网关程序,可在PC机上独立运行,程序通过串口通信(CDT规约)连接设备或系统信息,上层通过TCP103或104与主站通信。程序中包含实时数据保存、转发、CDT主站规约、TCP103规约(可与许继通信)、104规约等。
上传时间: 2016-06-22
上传用户:坏坏的华仔
103规约提供了继电保护设备(或测控设备)的信息接口规范。本标准适用于将继电保护和测量控制功能组合在一个设备内,只有一个通讯口的设备的信息接口,以及继电保护和测量控制功能分别由不同设备完成其功能的设备的信息接口。本规约属于问答式规约。在任何情况下,子站都不准主动向主站发送信息。
上传时间: 2016-07-17
上传用户:钓鳌牧马
词法分析器 对输入一个函数,并对其分析main() { int a,b a = 10 b = a + 20 }
上传时间: 2013-12-20
上传用户:hfmm633
基因算法,用VC++或MATLAB,java等工具设计一程序计算任一个随机产生的DNA基因表达式的有效长度和值 设随机产生的基因表达式为: + Q - / b * b a Q b a a b a a b b a a a b
上传时间: 2014-01-09
上传用户:aa54
函数再现机构设计 试设计一曲柄摇杆机构,再现函数 要求: 输入构件的转角范围180°,输出构件摆角范围30°,即: 当输入构件从a转至a+90时,输出构件从b转至b+30 当输入构件从a+90转至a+180时,输出构件从b+30转至b
上传时间: 2013-12-17
上传用户:英雄