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
是的protues的入门教程,对protues的使用的详解及和keil的结合仿真
上传时间: 2014-01-17
上传用户:qq21508895
用游标的方法实现对称差的计算,即 (A-B)+(B-A)
上传时间: 2016-05-23
上传用户:远远ssad
词法分析器 对输入一个函数,并对其分析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
上传用户:英雄
使用RS232串口2,通过Copley电机控制卡控制电机运转的VB程序。文件夹中包含有程序开发手册。 Using RS232 2 port, a VB program is developed for Copley motor control card, by which motors can move precisely. A handbook for program develpoment is involved in the rar file.
上传时间: 2016-09-21
上传用户:qiao8960
含PPT和书中的例图,《基于PROTEUS的电路及单片机系统设计与仿真》随书光盘
标签:
上传时间: 2013-12-20
上传用户:hanli8870
控制小车用PWM方式来控制小车的转速,小车的步进电机需要用直流电机控制,因为单片机产生的电流小,需要驱动
上传时间: 2016-09-24
上传用户:我干你啊
使用RS232串口2,通过Copley电机控制卡控制电机运转的VC程序。并且程序开发手册也包含在文件夹内。 Using RS232 2 port, a VC program is developed for Copley motor control card, by which motors can move precisely. And a handbook for program development is inclued in the rar file.
上传时间: 2014-12-20
上传用户:水口鸿胜电器