美女扒开腿免费视频_蜜桃传媒一区二区亚洲av_先锋影音av在线_少妇一级淫片免费放播放_日本泡妞xxxx免费视频软件_一色道久久88加勒比一_熟女少妇一区二区三区_老司机免费视频_潘金莲一级黄色片_精品国产精品国产精品_黑人巨大猛交丰满少妇

COMP2013代做、代寫(xiě)Data Structures and Algorithms
COMP2013代做、代寫(xiě)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ī)打開(kāi)當(dāng)前頁(yè)
  • 上一篇:代寫(xiě)DTS101TC、代做Python設(shè)計(jì)編程
  • 下一篇:CS 161代做、Java/Python程序代寫(xiě)
  • 無(wú)相關(guān)信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲(chóng)
    油炸竹蟲(chóng)
    酸筍煮魚(yú)(雞)
    酸筍煮魚(yú)(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚(yú)
    香茅草烤魚(yú)
    檸檬烤魚(yú)
    檸檬烤魚(yú)
    昆明西山國(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

    美女扒开腿免费视频_蜜桃传媒一区二区亚洲av_先锋影音av在线_少妇一级淫片免费放播放_日本泡妞xxxx免费视频软件_一色道久久88加勒比一_熟女少妇一区二区三区_老司机免费视频_潘金莲一级黄色片_精品国产精品国产精品_黑人巨大猛交丰满少妇
    一道本在线观看| japanese中文字幕| 色呦呦一区二区| 成年人免费观看视频网站 | v天堂中文在线| 九九九视频在线观看| 一区二区三区四区影院| 影音先锋男人看片资源| 99久久久无码国产精品性波多 | 精品无码av一区二区三区| 亚洲成人av免费在线观看| 久久国产波多野结衣| 免费网站在线高清观看| 免费的av网站| 国产十六处破外女视频| 国内偷拍精品视频| аⅴ天堂中文在线网| 亚洲综合自拍网| 国产乱淫av麻豆国产免费| 国产在线观看免费视频软件| 国产免费嫩草影院| 亚洲不卡在线播放| 成人在线手机视频| 久久精品成人av| 国产第一页精品| 波多野在线播放| 亚洲精品视频大全| 国产又粗又硬视频| 50一60岁老妇女毛片| 非洲一级黄色片| 黄色免费看视频| 人体私拍套图hdxxxx| 韩国三级视频在线观看| 中文字幕第六页| 搡老熟女老女人一区二区| 97人妻精品一区二区三区免费 | 男女全黄做爰文章| 天天舔天天操天天干| 99精品欧美一区二区| 亚洲天堂岛国片| 日韩av片在线免费观看| jizzjizzjizz国产| 99久久婷婷国产综合| 99re久久精品国产| 人妻精品久久久久中文字幕| 黄色国产在线观看| 久操视频在线观看免费| 久草福利资源在线| 91视频免费入口| 色婷婷精品久久二区二区密| 人妻体内射精一区二区三区| 女人被狂躁c到高潮| 久久久久亚洲av无码a片| 亚洲精品电影院| 佐山爱在线视频| 一本色道综合久久欧美日韩精品| 亚洲狠狠婷婷综合久久久久图片| 精品人伦一区二区三电影| 国产精品69久久久久孕妇欧美| 在线观看亚洲网站| 毛茸茸free性熟hd| www亚洲色图| 欧美丰满熟妇bbb久久久| www.超碰97| 国产一区二区播放| 女人被狂躁c到高潮| 国产老头老太做爰视频| 久久人妻少妇嫩草av无码专区| 久久久久久久毛片| 老熟女高潮一区二区三区| 欧美日韩高清丝袜| 美女又黄又免费的视频| 希岛爱理中文字幕| 亚洲av无码国产精品久久| 精品无码久久久久成人漫画| 久久人人妻人人人人妻性色av| 一本在线免费视频| 免费无码一区二区三区| 原创真实夫妻啪啪av| 在线国产视频一区| 亚洲天堂美女视频| 午夜av入18在线| 国产一二三四视频| 亚洲av无码成人精品国产| 无码人妻一区二区三区精品视频| 狂野欧美性猛交| 少妇特黄一区二区三区| 中国特级黄色片| 色婷婷在线视频观看| 国产免费嫩草影院| 熟女少妇内射日韩亚洲| 日本黄色特级片| 国产精品手机在线观看| 人妻精品久久久久中文字幕69| 91免费在线看片| 五月天婷婷丁香网| a资源在线观看| www色com| 欧美丰满老妇熟乱xxxxyyy| 免费成人深夜夜行p站| 日本人妻一区二区三区| 欧美体内she精高潮| 精品人妻一区二区三| 18精品爽国产三级网站| 女人被狂躁c到高潮| 久久中文字幕人妻| 99久久久无码国产精品性| 国精产品一区一区三区免费视频| 丰满大乳奶做爰ⅹxx视频 | 激情五月激情综合| 免费黄色国产视频| 久久精品亚洲a| 好吊色视频在线观看| 日韩成人av影院| yy6080午夜| 91中文字幕永久在线| 丰腴饱满的极品熟妇| 一级在线观看视频| 黑人操日本美女| 佐山爱在线视频| 最近中文字幕无免费| 国产中年熟女高潮大集合| 懂色av蜜桃av| 免费在线黄色网| 成年人小视频在线观看| 波多野结衣 在线| 亚洲欧美卡通动漫| 亚洲av无码专区在线播放中文| 欧美精品黑人猛交高潮| 9.1片黄在线观看| 国产a级片视频| 一级在线观看视频| 日本中文字幕免费在线观看| 你懂得在线视频| 小嫩苞一区二区三区| 手机免费看av片| 麻豆视频免费在线播放| 一级全黄裸体片| 色屁屁草草影院ccyy.com| 欧洲成人午夜精品无码区久久| 日本少妇高潮喷水xxxxxxx| 综合五月激情网| 国产男男chinese网站| 欧美三级黄色大片| 久久只有这里有精品| 日韩精品――色哟哟| 丁香激情五月少妇| 一本色道久久hezyo无码| 中文字幕第二区| 国产精品手机在线观看| 色欲一区二区三区精品a片| 扒开jk护士狂揉免费| 欧美性猛交xx| 国产aaaaaaaaa| 美女100%无挡| 久久人妻少妇嫩草av无码专区| 91视频青青草| 欧美成人另类视频| 中文字幕高清视频| 午夜免费福利影院| 深夜福利网站在线观看| 亚洲精品国产精品乱码在线观看| 国产精品jizz| 四季av综合网站| 国产精品一区二区人妻喷水| 放荡的美妇在线播放| 亚洲av无一区二区三区| 中文字幕一区二区久久人妻网站| 欧产日产国产v| 日韩三级久久久| 国产探花视频在线| 国产精品无码无卡无需播放器| 韩国无码一区二区三区精品| 水蜜桃av无码| 日本免费福利视频| 欧美bbbbb性bbbbb视频| 菠萝菠萝蜜网站| 亚洲欧美视频在线播放| 亚洲一级av无码毛片精品| 欧美日韩人妻精品一区在线| 性一交一黄一片| 在线中文字日产幕| 中文字幕第九页| 800av在线播放| 永久免费看mv网站入口78| 成人片黄网站色大片免费毛片| 90岁老太婆乱淫| 人妻熟人中文字幕一区二区| 国产极品视频在线观看| 国产精品久久国产精麻豆96堂| www.av免费| 国产精品嫩草69影院| 五月天激情小说| 在线不卡av电影| 国产麻豆视频在线观看| 又大又长粗又爽又黄少妇视频| 中国极品少妇xxxx| 先锋影音av在线| 欧美三级黄色大片| 伊人久久一区二区三区|