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.
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).
shc是一個加密shell腳本的工具.它的作用是把shell腳本轉換為一個可執行的二進制文件.
用shell腳本對系統進行自動化維護,簡單,便捷而且可移植性好.
但shell腳本是可讀寫的,很有可能會泄露敏感信息,如用戶名,密碼,路徑,IP等.
同樣,在shell腳本運行時會也泄露敏感信息.
shc是一個加密shell腳本的工具.它的作用是把shell腳本轉換為一個可執行的二進制文件.
這就很好的解決了上述問題.
tar zxvf shc-3.8.tgz
cd shc-3.8
make test
make
make test
make strings
make install 這一步需要root權限
使用方法:
shc -r -f script-name 注意:要有-r選項, -f 后跟要加密的腳本名.
運行后會生成兩個文件,script-name.x 和 script-name.x.c
script-name.x是加密后的可執行的二進制文件.
./script-name 即可運行.
script-name.x.c是生成script-name.x的原文件(c語言)