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.
资源简介: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 ...
上传时间: 2016-01-17
上传用户:jeffery
资源简介:Over the past years, we have witnessed destructions of various kinds caused by human actions. As a university student, write a letter to our society to
上传时间: 2014-11-23
上传用户:一诺88
资源简介:Since the field of object oriented programming is probably new to you, you will find that there is a significant amount of new terminology for you to grasp. This is true of any new endeavor and you should be warned not to be intimidated by ...
上传时间: 2014-12-06
上传用户:aappkkee
资源简介:with vxworks we can develope a group of control software for industry.
上传时间: 2015-06-12
上传用户:2404
资源简介:Foreword The four case studies that follow each have a number of common features. They each illustrate the birth of an idea and show how that idea can be realised into a marketable product. Each case study deals with engineering design and...
上传时间: 2016-02-17
上传用户:熊少锋
资源简介:Custom Visual Basic Packager and Installer for Visual Basic Developers. This is a group of standard exe projects 1. Packager 2. Setup1 The packager works like Visual basic Application deployment Wizard. And the setup1 project is used for ...
上传时间: 2017-02-26
上传用户:FreeSky
资源简介:A group of word-analysis examples for C++/STL novices
上传时间: 2013-12-24
上传用户:cx111111
资源简介:This a online education system that has not been completed yet.We have a long way to go to consummate this system.Let s work hard together and obtain more and more knowledge !
上传时间: 2015-06-04
上传用户:kelimu
资源简介:A thread pool is a group of a limited number of threads that are used to execute tasks.
上传时间: 2015-09-26
上传用户:qq1604324866
资源简介:Generate all XPaths for a group of XML Files.
上传时间: 2016-01-20
上传用户:kbnswdifs