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
The XML Toolbox converts MATLAB data types (such as double, char, struct, complex, sparse, logical) of any level of nesting to XML format and vice versa.
For example,
>> project.name = MyProject
>> project.id = 1234
>> project.param.a = 3.1415
>> project.param.b = 42
becomes with str=xml_format(project, off )
"<project>
<name>MyProject</name>
<id>1234</id>
<param>
<a>3.1415</a>
<b>42</b>
</param>
</project>"
On the other hand, if an XML string XStr is given, this can be converted easily to a MATLAB data type or structure V with the command V=xml_parse(XStr).
標簽:
converts
Toolbox
complex
logical
上傳時間:
2016-02-12
上傳用戶:a673761058
本文提出了一種基于comPactFlash(CF)接口的便攜式數據采集系統的設計方案,采用
可編程邏輯器件實現CF接口控制及數據采集控制:CF接口部分實現與上位機的數據傳
送,數據采集控制部分完成量程變換!模數轉換控制等功能"上位機基于CF接口與下位
機進行數據通信,給下位機發送量程控制字!數據采集參數等命令,采用中斷方式接收下
位機采集過來的數據并進行處理,下位機只完成數據的采集"這種方案最大的優勢是上位
機端的數據處理軟件易于修改,以面向不同的應用"
目前基于CF接口的設計采用專用芯片實現接口控制,由FPGA!DSP等實現邏輯功
能,這種多芯片方案雖然設計簡單,但成本高,功耗大"本課題首先根據CF規范,設計
了一種基于可編輯邏輯器件的CF卡端接口,實現了存儲器模式和I/O模式兩種傳輸方式
的接口設計,并在此基礎上完成了數據采集系統的設計"相比較傳統方案,本方案設計靈
活,系統成本和功耗更低"此外,本課題設計的基于可編輯邏輯器件的CF卡端接口具有
通用性,在此基礎上可實現其它多種基于CF接口的便攜式I/O設備"
本課題完成的數據采集系統中,用于邏輯控制的可編程邏輯器件采用了FPGA和
CPLD兩種實現方案"在完成系統的硬件和軟件設計后,對系統進行了測試,結果表明系
統成功地實現了數據采集!處理!顯示和控制,采用CPLD作為本設計的邏輯控制在系
統功耗方面具有明顯的優勢"
標簽:
ComPactFlash接口可編輯邏輯器件數據采集系統
上傳時間:
2015-05-25
上傳用戶:wjc511