免费一级欧美片在线观看网站_国产一区再线_欧美日本一区二区高清播放视频_国产99久久精品一区二区300

COMP2013代做、代寫Data Structures and Algorithms
COMP2013代做、代寫Data Structures and Algorithms

時(shí)間:2024-04-24  來(lái)源:  作者: 我要糾錯(cuò)



COMP2013 Data Structures and Algorithms
Programming Assignment 2 Deadline: 10:00am, 22th April, 2024
Instructions
 Submit the soft-copy of your program to Learn@PolyU
 You can only submit one program file (either C++ or Java or Python),
and the filename must follow the format below.
Language Filename format Filename example
C++ mainStudentID.cpp main10987654d.cpp
Java mainStudentID.java main10987654d.java
Python mainStudentID.py main10987654d.py
- We only accept file types in .cpp, .java, .py. We do not accept file types like .ipynb, .h, etc.
Section 1. Problem
You have n pipes with lengths in meters. You need to connect all these pipes into one pipe. You can
connect two pipes into one at a time. For two pipes with length i and j meters respectively, the cost to
connect them is 𝑡𝑡(𝑖𝑖,𝑗𝑗) = 𝑚𝑚𝑚𝑚𝑚𝑚(𝑖𝑖,𝑗𝑗) + 3; the connected pipe has length i+j meters.
The task is to minimize the total cost to connect all n pipes into one pipe, where the total cost is the sum
of all connection costs.
Example: you have 4 pipes in length 6, 5, 2, 8. After connecting all pipes, you will get one pipe with
length 21 meters. Your task is to minimize the total cost to connect these pipes into one. There can be
different ways to perform the connections. Given 4 pipes, there are  
4
2  ×  
3
2  = 18 ways to perform the
connections, and below shows one possible way (not with optimal cost),
- Connect pipes with length 6,5 first, with cost 9, and result in three pipes with length 11,2,8
- Then connect pipes with length 11, 2, with cost 14, and result in two pipes with length 13, 8
- Then connect pipes with length 13, 8, with cost 16, and result in one pipe with length 21.
- The total cost of the connections above is 9+14+16=39.
For this example, an optimal way to connect pipes should have minimum cost 34.
Given n pipes, implement a greedy algorithm that can correctly obtain the minimum total cost to connect
them into one pipe, adhering to the requirements above. Your program should have time complexity
O(nlogn). (You do not need to prove the optimality of your greedy algorithm.)
Section 2. input and output of your format
In the table below, it shows a sample of the input file and the output of your program. Your program
should take as input a filename (e.g., file1.txt), and then read the integers (one integer per line) in the file.
These integers are the length of pipes. The number of non-empty lines in the file is the number of pipes
you need to handle.
Your program will output an integer value to the screen, which is the minimum cost obtained by your
program.
Sample input file “file1.txt” The output on screen (stdout)
6 34
5
2
8
We will run your program by a command line like:
where the argument “file1.txt” is an example of the input filename.
Your program should only output the result number.
Please follow the above output format and DO NOT print any extra information.
Notes:
- We will use 10 test cases to grade your program
- The pipe length is positive integer in range [1, 1000]
- In a test case, the number of pipes is at most 10000.
Implementation Instructions:
In your implementation, you can use existing libraries that support data structures like list, stack, queue,
min-heap, max-heap, priority-queue, etc. (In other words, you do not need to implement these
fundamental data structures)
You are allowed to use operator or standard library function (e.g., in C++, Java, Python) to perform
lexicographic comparison for string. Examples:
• C++: https://cplusplus.com/reference/string/string/compare/
• Java: https://docs.oracle.com/javase/tutorial/java/data/comparestrings.html
• Python: https://docs.python.org/3/library/stdtypes.html#comparisons
Section 3: Grading Criteria
Naming conventions, compilation and execution commands
 Before submission, rename your program to
 mainStudentID.cpp, e.g., main10987654d.cpp
 OR mainStudentID.java, e.g., main10987654d.java
 OR mainStudentID.py, e.g., main10987654d.py
 [C++ and Java only] Make sure that you can compile your program using the command:
 g++ mainStudentID.cpp -o mainStudentID
 OR javac mainStudentID.java
o No marks will be given if your program cannot be compiled.
Language Command line
C++ (after compilation) ./mainStudentID file1.txt
Java (after compilation) java mainStudentID file1.txt
Python python mainStudentID.py file1.txt
 We will run your program by a command line like:
 ./mainStudentID file1.txt
 OR java mainStudentID file1.txt
OR python mainStudentID.py file1.txt
where the argument “file1.txt” is an example of the input filename.
Make sure that you can execute the above commands on the COMP apollo server successfully.
Otherwise, no marks will be given. The current versions on apollo are as follows:
g++ (GCC) 4.8.5, javac 1.8.0_20, Python 2.7.5
Test files for grading
Total marks: 100 marks
Your program will be graded by using 10 test files.
For each test case, if your program can return the correct output within 1 minute, it is a successful case
and you get 10 marks. Otherwise, this is a failed case with 0 marks.
- The running time of your program will be measured on the COMP apollo server.
If your program is not a greedy approach, extra 50 marks will be deducted from the total marks you
get from the 10 test cases above. Final grade of the assignment is in the range [0,100].
Appendix
(1) How to activate your COMP account?
Please click the following link to activate your COMP account:
https://acct.comp.polyu.edu.hk/
according to the instructions in:
https://acct.comp.polyu.edu.hk/files/COMPStudentAccountSelfActivation.pdf
(2) How to login the COMP apollo server?
[Step 1]
Use PuTTY (or any SSH client
program)
Enter the host name
csdoor.comp.polyu.edu.hk
Click the “Open” button.
If you see the message “The host
key is not cached for this
server…”,
just accept to continue.
[Step 2]
Enter your COMP account
username and password.
Note that, when you are entering
the password, it is not displayed
in PuTTY.
[Step 3]
Enter the hostname apollo
Then enter your COMP account
password (the same as in Step 2).
[Step 4]
Use WinSCP (or any SFTP client program).
Enter the host name csdoor.comp.polyu.edu.hk
Enter your COMP account username and password.
Upload your program to the server.

請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp









 

標(biāo)簽:

掃一掃在手機(jī)打開當(dāng)前頁(yè)
  • 上一篇:代寫DTS101TC、代做Python設(shè)計(jì)編程
  • 下一篇:CS 161代做、Java/Python程序代寫
  • 無(wú)相關(guān)信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國(guó)家級(jí)風(fēng)景名勝區(qū)
    昆明西山國(guó)家級(jí)風(fēng)景名勝區(qū)
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗(yàn)證碼平臺(tái) 理財(cái) WPS下載

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    免费一级欧美片在线观看网站_国产一区再线_欧美日本一区二区高清播放视频_国产99久久精品一区二区300
    色成人在线视频| 欧美成人在线直播| 亚洲观看高清完整版在线观看| 色天天综合久久久久综合片| 夜夜嗨av一区二区三区四季av| 欧美性做爰猛烈叫床潮| 五月婷婷综合在线| 91精品国产色综合久久ai换脸| 捆绑紧缚一区二区三区视频| 久久毛片高清国产| 成人美女视频在线观看18| 亚洲欧洲av在线| 欧美日韩一级二级| 免费精品视频在线| 精品国产自在久精品国产| 国产91在线|亚洲| 亚洲日本一区二区| 欧美日韩成人综合| 狠狠色丁香婷综合久久| 亚洲国产精品99久久久久久久久| 91香蕉国产在线观看软件| 亚洲高清一区二区三区| 日韩一级视频免费观看在线| 国产成人av一区二区| 成人免费在线播放视频| 欧美日韩精品一区二区三区四区| 美腿丝袜在线亚洲一区| 亚洲国产成人在线| 欧美午夜宅男影院| 久久99精品国产麻豆不卡| 亚洲国产精华液网站w | 国产精品18久久久久久久久 | 亚洲欧美日韩一区二区| 欧美日韩亚洲另类| 国产在线精品一区二区不卡了| 国产精品久久久久久久久免费樱桃| 欧美日韩一区二区三区四区| 国产在线一区二区| 成人精品视频一区二区三区| 亚洲综合一区二区三区| 精品理论电影在线| 91麻豆免费在线观看| 奇米影视在线99精品| 国产精品盗摄一区二区三区| 在线成人免费视频| 福利一区在线观看| 亚洲成人午夜电影| 国产三级三级三级精品8ⅰ区| 欧美一a一片一级一片| 国产在线视频精品一区| 亚洲综合免费观看高清完整版在线| 精品动漫一区二区三区在线观看| 色婷婷精品大在线视频| 六月丁香综合在线视频| 亚洲免费在线看| 精品播放一区二区| 欧美视频精品在线观看| 岛国精品在线观看| 日韩成人一区二区| 亚洲日本护士毛茸茸| 欧美精品一区二区三区在线| 欧美亚洲国产bt| 成人高清视频在线观看| 蜜桃视频在线观看一区二区| 亚洲精品成人悠悠色影视| 久久蜜桃av一区二区天堂| 欧美剧情片在线观看| av亚洲精华国产精华精| 国内偷窥港台综合视频在线播放| 亚洲综合在线电影| 国产精品天美传媒沈樵| 日韩欧美视频一区| 欧美性视频一区二区三区| 成人免费视频一区二区| 激情综合网av| 亚州成人在线电影| 亚洲视频小说图片| 国产日韩欧美综合一区| 日韩一级黄色大片| 欧美日韩一区二区电影| 91丝袜美腿高跟国产极品老师| 国产精品911| 日韩一区二区不卡| 日本道免费精品一区二区三区| 国产成人a级片| 九九**精品视频免费播放| 午夜精品久久久久久久| 亚洲综合激情网| 亚洲日本成人在线观看| 国产精品免费观看视频| 久久久电影一区二区三区| 日韩欧美高清在线| 91精品欧美久久久久久动漫| 欧美午夜在线一二页| 日本精品裸体写真集在线观看 | 欧美日韩国产影片| 在线观看av一区二区| 91亚洲精品久久久蜜桃网站| 成人午夜精品在线| 国产成人亚洲综合a∨婷婷图片 | 精品一区二区三区免费播放 | 国产一区二区三区四区五区入口| 免费观看成人av| 婷婷中文字幕综合| 日韩国产欧美视频| 午夜电影网一区| 性欧美疯狂xxxxbbbb| 亚洲福中文字幕伊人影院| 一区二区三区不卡在线观看 | 国产精品免费av| 中文字幕精品三区| 日本一区二区免费在线观看视频 | 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 午夜久久福利影院| 亚洲电影在线免费观看| 亚洲国产欧美另类丝袜| 亚洲国产欧美日韩另类综合| 亚洲高清免费一级二级三级| 亚洲一区二区在线观看视频| 亚洲国产精品影院| 午夜精品久久久久久久99水蜜桃| 日日摸夜夜添夜夜添国产精品 | 国产一区二区美女诱惑| 国产福利一区在线观看| 成人爱爱电影网址| 97久久久精品综合88久久| 99视频国产精品| 91色porny在线视频| 91黄色在线观看| 欧美日韩亚洲综合一区二区三区| 91精品国产手机| 精品少妇一区二区三区视频免付费| 精品国精品自拍自在线| 欧美经典三级视频一区二区三区| 中文字幕一区二区三区在线不卡| 自拍偷拍国产精品| 亚洲一区二区三区免费视频| 丝瓜av网站精品一区二区| 久久精品国产99久久6| 国产精品一区二区三区网站| 不卡免费追剧大全电视剧网站| 色综合久久久久综合体桃花网| 欧美揉bbbbb揉bbbbb| 7777精品伊人久久久大香线蕉超级流畅| 欧美一区二区三区男人的天堂| 久久亚洲综合色| 国产精品成人一区二区三区夜夜夜| 亚洲另类春色校园小说| 日韩精品午夜视频| 国产在线精品一区二区 | 99久久国产综合精品麻豆| 欧美唯美清纯偷拍| 精品国产乱码久久久久久久久| 中文在线免费一区三区高中清不卡| 亚洲欧美一区二区三区孕妇| 香蕉久久夜色精品国产使用方法| 久久激情五月激情| 成人禁用看黄a在线| 欧美性色aⅴ视频一区日韩精品| 日韩欧美电影在线| 国产精品免费免费| 天天操天天综合网| 国产精品一区二区视频| 在线观看视频欧美| 精品国产123| 伊人夜夜躁av伊人久久| 久久精品国产第一区二区三区| 99综合电影在线视频| 6080yy午夜一二三区久久| 国产欧美一区二区三区鸳鸯浴 | 亚洲一区二区三区美女| 韩国精品免费视频| 色偷偷久久人人79超碰人人澡| 欧美一区三区四区| 国产精品久久久久三级| 视频一区二区不卡| 成人av午夜电影| 日韩亚洲欧美成人一区| 亚洲欧洲日韩在线| 久色婷婷小香蕉久久| 一本大道综合伊人精品热热| 日韩一区二区在线观看视频播放| 中文字幕一区二区三区在线不卡| 五月婷婷综合网| 99免费精品在线观看| 日韩午夜在线播放| 中文字幕中文字幕在线一区| 日本强好片久久久久久aaa| 不卡视频在线看| 欧美精品一区二区三区很污很色的| 一区二区成人在线| 国产精品系列在线播放| 欧美精品第一页| 亚洲天天做日日做天天谢日日欢| 日韩视频一区二区| 亚洲乱码国产乱码精品精98午夜| 国产精品伊人色| 日韩欧美一二区| 亚洲电影欧美电影有声小说| 99久久综合国产精品|