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

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

時間:2024-04-24  來源:  作者: 我要糾錯



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.

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp









 

標簽:

掃一掃在手機打開當前頁
  • 上一篇:代寫DTS101TC、代做Python設計編程
  • 下一篇:CS 161代做、Java/Python程序代寫
  • 無相關信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國家級風景名勝區
    昆明西山國家級風景名勝區
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗證碼平臺 理財 WPS下載

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    美女扒开腿免费视频_蜜桃传媒一区二区亚洲av_先锋影音av在线_少妇一级淫片免费放播放_日本泡妞xxxx免费视频软件_一色道久久88加勒比一_熟女少妇一区二区三区_老司机免费视频_潘金莲一级黄色片_精品国产精品国产精品_黑人巨大猛交丰满少妇
    涩视频在线观看| 欧美老熟妇一区二区三区| 免费观看黄网站| 日韩aaaaa| 性猛交╳xxx乱大交| 日韩乱码人妻无码中文字幕久久| 亚洲色偷偷综合亚洲av伊人| 性猛交ⅹxxx富婆video| 久久中文字幕人妻| 成年人网站免费看| japanese中文字幕| 日韩中文字幕电影| 精品国产无码在线观看| 国产成人av一区二区三区不卡| 精品熟女一区二区三区| 污片免费在线观看| 免费中文字幕av| 欧洲av一区二区三区| 日本黄区免费视频观看| 国产探花视频在线播放| 精品在线观看一区| 美女扒开腿免费视频| 精品人妻在线视频| 女~淫辱の触手3d动漫| 一区二区伦理片| 中文字幕亚洲欧美日韩| 五月天激情小说| 国产中年熟女高潮大集合| 无码少妇精品一区二区免费动态| 欧美亚洲色综久久精品国产| 午夜爽爽爽男女免费观看| 欧洲成人午夜精品无码区久久| 91av在线免费| 黄色激情小视频| 水蜜桃av无码| 秋霞欧美一区二区三区视频免费| 熟女人妻一区二区三区免费看| 久久久亚洲av波多野结衣| 亚洲综合久久av一区二区三区| 亚洲精品鲁一鲁一区二区三区| 色欲av无码一区二区三区| 亚洲av鲁丝一区二区三区| 草草地址线路①屁屁影院成人| 欧美色视频一区二区三区在线观看| 亚洲美女高潮久久久| 99国产精品免费| 精品夜夜澡人妻无码av| 免费观看一区二区三区| 亚洲欧美另类日本| 夫妇露脸对白88av| 亚洲日本精品视频| 国产精品毛片一区二区| 国产精九九网站漫画| 2025国产精品自拍| 国产尤物在线播放| 久久成人小视频| 青青草自拍偷拍| 中文字幕av久久爽一区| 男人的天堂官网| 欧美另类z0zx974| 久久久久久久久久久国产精品| 欧美一级大片免费看| 国产在线一卡二卡| 成年人性生活视频| 人妻巨大乳一二三区| 少妇性l交大片7724com| 潘金莲一级淫片aaaaa| 性色av浪潮av| www国产视频| jizz欧美性20| av黄色在线免费观看| 91黄色免费视频| 亚洲最大成人网站| 91麻豆精品国产91久久综合| 色婷婷国产精品免| 爱爱视频免费在线观看| 粗大的内捧猛烈进出视频| 欧美夫妇交换xxx| 国产熟妇久久777777| 日本一二三不卡视频| 无码人妻精品中文字幕| 印度午夜性春猛xxx交| 美女扒开腿免费视频| 欧美成人三级伦在线观看| 人妻少妇一区二区| 极品色av影院| 艳妇乳肉亭妇荡乳av| 18精品爽国产三级网站| 男女羞羞免费视频| 麻豆国产精品一区| 奇米网一区二区| 成熟妇人a片免费看网站| 天天干天天操天天拍| 黑人巨大精品一区二区在线| a级一a一级在线观看| 萌白酱视频在线| 丰满人妻一区二区三区免费视频棣| 成年人在线观看av| 一级黄色免费毛片| a视频免费观看| 少妇丰满尤物大尺度写真| jizz中文字幕| 在线xxxxx| 国产老头老太做爰视频| 国产精品手机在线观看| 三级在线观看免费大全| 一本加勒比波多野结衣| 亚洲 欧美 变态 另类 综合| 魔女鞋交玉足榨精调教| 亚洲av无一区二区三区久久| 夫妇交换中文字幕| 亚洲午夜久久久久久久久红桃| 亚洲av无一区二区三区久久| 欧美88888| 国产探花视频在线播放| aaaaa一级片| 麻豆短视频在线观看| 污污的视频在线免费观看| 永久免费毛片在线观看| 菠萝菠萝蜜网站| 国产伦精品一区二区三区精品| 欧美人禽zoz0强交| 日本一级特级毛片视频| 2014亚洲天堂| 中日韩一级黄色片| 成熟的女同志hd| 日批视频在线看| 好吊操视频这里只有精品| 野花视频免费在线观看| 4438x全国最大成人| 欧美一级片在线免费观看| 成年人看片网站| 亚洲精品乱码久久久久久蜜桃欧美| 人妻精品久久久久中文字幕69| 成人免费播放视频| 中文字幕1区2区| 欧美肉大捧一进一出免费视频| 欧美一级片黄色| 免费黄色在线视频| 中文字幕第24页| 国产a免费视频| 国产精品边吃奶边做爽| 久久久久亚洲AV成人无在| 99热99这里只有精品| 在线播放第一页| 日韩在线免费观看av| 国产熟女一区二区| 51精品免费网站| 国产 xxxx| 视频国产一区二区| 无码人妻aⅴ一区二区三区玉蒲团| 久久免费精品国产| 亚洲午夜精品久久久久久高潮| 奇米网一区二区| 中文字幕三级电影| 国产不卡在线观看视频| 国产人妖在线观看| 精品欧美一区二区久久久| 丝袜美腿小色网| 亚洲午夜久久久久久久久红桃| 国产喷水在线观看| 中文在线一区二区三区| 日韩视频中文字幕在线观看| 中国极品少妇videossexhd| 人妻熟人中文字幕一区二区| 国内自拍偷拍视频| 91香蕉国产视频| 波多野结衣影院| 中文在线字幕在线观看| 亚洲图片第一页| 亚洲熟妇一区二区三区| 成年人看片网站| 国产1区2区3区4区| 亚洲综合第一区| 老牛影视av老牛影视av| 又色又爽又黄18网站| 我不卡一区二区| 国产 欧美 在线| 亚洲天堂美女视频| 性欧美18—19sex性高清| 人妻体体内射精一区二区| 欧美一区免费观看| 乱老熟女一区二区三区| 久久久久国产精品区片区无码| 国产a免费视频| 草视频在线观看| 中文字幕乱码在线人视频| 欧美黑人性猛交xxx| 免费在线观看黄色小视频| 久久精品一区二区三区四区五区| 天天干天天操天天拍| 五月婷婷欧美激情| 国产精品20p| 激情高潮到大叫狂喷水| 超碰人人人人人人人| 国产麻豆a毛片| 一级黄色录像视频| 日本精品一二三| 大地资源二中文在线影视观看| 一级黄色片毛片|