爱情鸟第一论坛com高清免费_91免费精品国自产拍在线可以看_亚洲一区精品中文字幕_男人操心女人的视频

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

    爱情鸟第一论坛com高清免费_91免费精品国自产拍在线可以看_亚洲一区精品中文字幕_男人操心女人的视频
    <strike id="bfrlb"></strike><form id="bfrlb"><form id="bfrlb"><nobr id="bfrlb"></nobr></form></form>

        <sub id="bfrlb"><listing id="bfrlb"><menuitem id="bfrlb"></menuitem></listing></sub>

          <form id="bfrlb"></form>

            <form id="bfrlb"></form>

              <address id="bfrlb"></address>

              <address id="bfrlb"></address>
              国内在线观看一区二区三区| 亚洲电影网站| 亚洲欧美区自拍先锋| 亚洲深夜av| 欧美日韩亚洲一区二区三区四区| 国产精品美女在线观看| 欧美日韩亚洲国产一区| 亚洲人精品午夜| 亚洲成色最大综合在线| 欧美精品一区二区三区四区| 亚洲日本va午夜在线电影| 性xx色xx综合久久久xx| 欧美日韩国产一区二区三区| 欧美三级在线视频| 一区二区视频在线观看| 亚洲电影免费在线| 国产女同一区二区| 韩国在线视频一区| 国产亚洲激情视频在线| 久久婷婷久久| 亚洲欧洲在线观看| 久久黄色网页| 美女网站在线免费欧美精品| 久久综合九色综合欧美就去吻| 久久亚洲图片| 久久激情五月激情| 欧美大尺度在线| 国产精品福利av| 亚洲国产毛片完整版| 欧美性猛交视频| 欧美精品久久天天躁| 欧美特黄一区| 亚洲一区二区动漫| 久久综合999| 国产精品电影在线观看| 国产香蕉97碰碰久久人人| 国产曰批免费观看久久久| 久久精品视频导航| 欧美精品一区二区蜜臀亚洲| 国产一区二区三区四区hd| 久久亚洲欧美| 欧美日韩在线免费视频| 欧美视频在线不卡| 欧美精品亚洲精品| 久久久久久久久久久成人| 欧美日韩无遮挡| 国产区欧美区日韩区| 怡红院av一区二区三区| 国产一区二区三区在线播放免费观看| 国产精品久久久久久久久久免费| 国产欧美一区二区在线观看| 亚洲国产精品成人综合色在线婷婷| 亚洲欧美清纯在线制服| 欧美一区二区三区男人的天堂| 猛男gaygay欧美视频| 欧美日韩精品免费在线观看视频| 伊人精品在线| 亚洲第一页在线| 亚洲日本理论电影| 欧美午夜宅男影院| 欧美丝袜一区二区| 欧美午夜激情小视频| 一区二区久久久久| 伊人色综合久久天天| 亚洲第一中文字幕在线观看| 一区二区三区视频观看| 亚洲欧洲视频在线| 性色一区二区| 欧美日韩国产精品一区| 欧美在线免费观看视频| 亚洲与欧洲av电影| 欧美激情国产日韩精品一区18| 欧美一级淫片aaaaaaa视频| 亚洲网站在线看| 中文精品99久久国产香蕉| 国产欧美另类| 亚洲欧美视频在线观看| 精品99一区二区三区| 亚洲激情影院| 在线观看日韩| 欧美日韩久久精品| 国内精品免费在线观看| 欧美一区二区三区在线观看视频| 久久丁香综合五月国产三级网站| 亚洲美女中文字幕| 国产日韩精品久久| 国产亚洲视频在线观看| 在线观看日韩一区| 牛人盗摄一区二区三区视频| 亚洲视频综合在线| 国产精品久久久久久久久久久久| 国产一区免费视频| 欧美顶级大胆免费视频| 午夜在线成人av| 亚洲无线一线二线三线区别av| 亚洲人成网站在线播| 毛片av中文字幕一区二区| 国产一区二区三区在线观看视频| 欧美日本中文| 国产精品黄页免费高清在线观看| 亚洲成人在线视频播放| 久久精品视频在线观看| 欧美a级大片| 欧美国产精品专区| 欧美日韩国产成人在线91| 国产日韩欧美视频在线| 亚洲欧美日韩视频一区| 国产精品稀缺呦系列在线| 99精品国产一区二区青青牛奶| 欧美国产1区2区| 亚洲精品视频在线看| 欧美性理论片在线观看片免费| 一区二区亚洲欧洲国产日韩| 欧美日韩国产在线播放网站| 亚洲日本成人| 国产主播一区| 亚洲欧美视频在线观看| 欧美亚洲综合久久| 免费成人高清在线视频| 亚洲自拍啪啪| 久久成人免费网| 狠狠色丁香婷综合久久| 久久久久久综合| 国产精品久久久久aaaa九色| 亚洲国产福利在线| 欧美精品久久一区二区| 国产日韩精品视频一区二区三区| 国产一区二区三区无遮挡| 欧美日韩国产高清视频| 亚洲视频一区在线| 欧美日韩成人一区二区| 欧美在线观看视频| 欧美亚洲视频一区二区| 欧美日韩免费高清一区色橹橹| 国产一区二区三区免费在线观看| 国产精品手机视频| 尤物yw午夜国产精品视频| 久久综合伊人77777蜜臀| 亚洲人成亚洲人成在线观看图片| 亚洲欧洲偷拍精品| 国产精品yjizz| 国产精自产拍久久久久久| 欧美日韩另类国产亚洲欧美一级| 亚洲成色www久久网站| 欧美精品亚洲一区二区在线播放| 99国产欧美久久久精品| 欧美一区二区在线观看| 欧美人交a欧美精品| 欧美人与性禽动交情品| 在线看片第一页欧美| 国内精品久久久久久影视8| 欧美天天视频| 欧美成人免费在线观看| 欧美一区2区视频在线观看| 亚洲国产岛国毛片在线| 亚洲精品久久在线| 久久精品一区中文字幕| 中国成人黄色视屏| 久久综合狠狠| 亚洲日本中文| 欧美美女bb生活片| 国产精品护士白丝一区av| 欧美大片一区二区| 国内精品伊人久久久久av影院| 国产精品久久午夜夜伦鲁鲁| 亚洲福利av| 久久视频免费观看| 国产日韩视频| 欧美一区二区网站| 国内在线观看一区二区三区| 国产综合视频在线观看| 亚洲精品一区在线观看香蕉| 国产久一道中文一区| 欧美aaaaaaaa牛牛影院| 久久狠狠久久综合桃花| 亚洲在线视频一区| 欧美91视频| 亚洲欧美视频一区二区三区| 美腿丝袜亚洲色图| 国产日韩精品一区二区浪潮av| 亚洲一级片在线观看| 性色av一区二区怡红| 欧美大片18| 亚洲最黄网站| 91久久综合| 欧美性色aⅴ视频一区日韩精品| 久久亚洲国产精品日日av夜夜| 99精品国产在热久久婷婷| 欧美日韩在线三级| 欧美在线免费观看亚洲| 欧美1区2区| 性欧美xxxx大乳国产app| 久久精品一二三| 国产精品video| 国产一区二区三区精品久久久| 精品91视频| 国产精品日韩精品欧美在线| 免费观看成人鲁鲁鲁鲁鲁视频| 国产自产高清不卡| 欧美日一区二区三区在线观看国产免|