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
keil工程文件,控制舞台led流水灯的c程序
上传时间: 2013-12-24
上传用户:change0329
这是一个地磅称重管理系统.合适VB初学者进行数据库编程学习
上传时间: 2016-01-24
上传用户:luke5347
VXWORKS的学习入门,傻瓜式的教学.详细的解释
上传时间: 2013-12-24
上传用户:agent
如何在Delphi下实现画面捕捉、传输、以及文件的传输原理
上传时间: 2016-01-24
上传用户:dapangxie
自己用VHDL写的一个串口程序,调试成功,并且用到了项目中,希望初学者可以借鉴下
上传时间: 2016-01-24
上传用户:manking0408
51单片机USB通信模块, 51源程序
上传时间: 2013-12-24
上传用户:songnanhua
用java写的一个小游戏,有数字玩法和图像玩法两种,自己可以更改图片
上传时间: 2014-01-24
上传用户:lmeeworm
在TMS320F2812实现TCP/IP协议栈
上传时间: 2013-12-24
上传用户:王楚楚
大容量串行flash存储器AT45DB041的原理与应用the_principium_nd_application_of_AT45DB041_a_great_capacity_flash_memorizer.pdf。文档中包括at45db的读写程序
标签: the_principium_nd_application_of_ a_great_capacity_flash_memori 041 flash
上传时间: 2013-12-24
上传用户:aa17807091