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
USB通信程序使用USBDLL.dll檔的3個函式CheckHidDevice()、ReadUSB()、WriteUSB(),執行USB傳輸界面的輸出入。
標簽: CheckHidDevice WriteUSB ReadUSB USBDLL
上傳時間: 2016-06-23
上傳用戶:chongcongying
透過KEIL C51的程式,學習者可以了解車用控制器區域網路(Controller Area Network, CAN)的訊息傳輸方式。
上傳時間: 2016-09-05
上傳用戶:tb_6877751
透過a51的程式,學習者可以了解車用控制器區域網路(Controller Area Network, CAN)的訊息傳輸方式,有助於建立CAN-Bus傳輸的概念。
上傳時間: 2016-09-05
上傳用戶:極客
本文是以數位訊號處理器DSP(Digital Singal Processor)之核心架構為主體的數位式溫度控制器開發,而其主要分為硬體電路與軟體程式兩部分來完成。而就硬體電路來看分為量測電路模組、DSP周邊電路及RS232通訊模組、輸出模組三個部分,其中在輸出上可分為電流輸出、電壓輸出以及binary command給加熱驅動裝置, RS232 除了可以與PC聯絡外也可以與具有CPU的熱能驅動器做命令傳輸。在計畫中分析現有工業用加熱驅動裝置和溫度曲線的關係,並瞭解其控制情況。軟體方面即是溫控器之中央處理器程式,亦即DSP控制程式,其中包括控制理論、感測器線性轉換程式、I/O介面及通訊協定相關程式。在控制法則上,提出一個新的加熱體描述模型,然後以前饋控制為主並輔以PID控制,得到不錯的控制結果。
標簽: Processor Digital Singal DSP
上傳時間: 2013-12-24
上傳用戶:zjf3110
漢諾塔!!! Simulate the movement of the Towers of Hanoi puzzle Bonus is possible for using animation eg. if n = 2 A→B A→C B→C if n = 3 A→C A→B C→B A→C B→A B→C A→C
標簽: the animation Simulate movement
上傳時間: 2017-02-11
上傳用戶:waizhang
fix point版本的Ogg Vorbis decoder,外帶player程式,Vorbis格式的音樂檔在高音質的情況下可以得到比mp3更加的壓縮率,非常適用於網路傳輸或低記憶體環境。
上傳時間: 2013-12-18
上傳用戶:181992417
Verilog HDL的程式,上網找到SPI程式, vspi.v這程式相當好用可用來接收與傳送SPI,並且寫了一個傳輸信號測試,spidatasent.v這程式就是傳送的資料,分別為00 66... 01 77...... 02 55這樣的資料,並透過MAX+PULS II軟體進行模擬,而最外層的程式是test_createspi.v!
上傳時間: 2017-03-06
上傳用戶:onewq
將魔王的語言抽象為人類的語言:魔王語言由以下兩種規則由人的語言逐步抽象上去的:α-〉β1β2β3…βm ;θδ1δ2…-〉θδnθδn-1…θδ1 設大寫字母表示魔王的語言,小寫字母表示人的語言B-〉tAdA,A-〉sae,eg:B(ehnxgz)B解釋為tsaedsaeezegexenehetsaedsae對應的話是:“天上一只鵝地上一只鵝鵝追鵝趕鵝下鵝蛋鵝恨鵝天上一只鵝地上一只鵝”。(t-天d-地s-上a-一只e-鵝z-追g-趕x-下n-蛋h-恨)
上傳時間: 2013-12-19
上傳用戶:aix008