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
linux的启动讲解,希望对研究linux的人有帮助。
标签: linux
上传时间: 2013-12-20
上传用户:zhaiye
和同学编的连连看小游戏,希望大家能给出评价及修改意见
标签: 小游戏
上传时间: 2016-01-20
上传用户:waizhang
按键处理程序,很好用的哦
上传时间: 2016-01-20
上传用户:klin3139
谢希仁版<计算机网络第四版>答案完整版
上传时间: 2013-12-20
上传用户:lanwei
怎么样操作flash,flash在SD卡下的操作
上传时间: 2016-01-22
上传用户:sevenbestfei
关于射频IC卡国际标准的中文版,对设计射频卡读卡器有一定参考。
上传时间: 2013-12-19
上传用户:pinksun9
mptl和omptl一样,也是增加了STL对多核的支持。但是mptl封装的功能要更多一点
上传时间: 2013-12-26
上传用户:wyc199288
Library库画板 库画板应用 生成可执行文件 Library工作区 Entry菜单 创建pbl文件 给pbl文件加入描述信息 加注解的库文件
上传时间: 2013-12-20
上传用户:lili123
Tonadol下memShow源码,可以供研究使用。
上传时间: 2013-12-18
上传用户:shinesyh