日韩精品一区二区三区高清_久久国产热这里只有精品8_天天做爽夜夜做爽_一本岛在免费一二三区

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代寫Implementation of Graph Algorithms

時間:2023-11-14  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯


C++ Implementation of Graph Algorithms

1 Task Description

You are asked to use C++ to solve the following puzzle.

Hint: All it takes is an algorithm mentioned in this course (with a slight twist).

The graph is undirected!

2 Submission Guideline

You must follow this guideline! Your submission will be marked automatically. Failure to

follow this guideline will result in 0.

Your submission should contain exactly one file: main.cpp.

You do not need to submit a design.

3 Puzzle

You need to redesign the road system of an imaginary country.

The country is composed of N cities (for simplicity numbered from 0 to N − 1). Some pairs of cities are

connected by bidirectional roads. We say that there is a path between different cities A and B if there exists

a sequence of unique cities C1, C2, . . . , CM, such that C1 = A and CM = B and for each index i < M, there

is a road between cities Ci and Ci+1.

The current state of the road network is miserable. Some pairs of cities are not connected by any path. On

the other hand, other pairs of cities are connected by multiple different paths, and that leads to complicated

traffic routing. You want to build some new roads and destroy some of the already existing roads in the

country so that after the reconstruction there will exist exactly one path between every pair of distinct cities.

As building new roads and destroying old ones costs a lot of money, you want to minimize the total cost

spent on the reconstruction.

You are given three two-dimensional arrays:

• country[i][j]=1 or 0: there is an existing road between city i and j if and only if country[i][j]=1.

• build[i][j]: the cost for building a road between i and j. The values of build[i][j] are represented

using English letters. A, B, . . . , Z represent 0, 1, . . . , 25 and a, b, . . . , z represent 26, 27, . . . , 51. For

example, if build[2][4]=b, then that means the cost for building a road between city 2 and city 4 is

27.

• destroy[i][j]: the cost for destroying a road between i and j. Again, the values are represented

using English letters like the above.

Your task is to find and print the minimal cost needed for the road network reconstruction.

You don’t need to worry about invalid inputs.

1

• Sample input 1: 000,000,000 ABD,BAC,DCA ABD,BAC,DCA

Note: 000,000,000 describes the two-dimensional array country. ABD,BAC,DCA describes the twodimensional array build. ABD,BAC,DCA describes the two-dimensional array destroy. The input

format is: three strings separated by spaces; each string contains N parts separated by commas; each

part contains N characters.

Sample output 1: 3

Comment: There are three cities, totally disconnected.

• Sample input 2: 011,101,110 ABD,BAC,DCA ABD,BAC,DCA

Sample output 2: 1

Comment: Now the three cities form a connected triangle and we need to destroy one road. Optimal

solution is to destroy the road between the cities 0-1 (cost 1).

• Sample input 3: (note: all inputs are on the same line. I just couldn’t fit them in one line in this pdf.)

011000,101000,110000,000011,000101,000110

ABDFFF,BACFFF,DCAFFF,FFFABD,FFFBAC,FFFDCA

ABDFFF,BACFFF,DCAFFF,FFFABD,FFFBAC,FFFDCA

Sample output 3: 7

Comment: We have six cities forming two separate triangles. Destroy one road in each triangle (costs

1 for each road) and then join the triangles by a new road (costs 5).

• Sample input 4: 0 A A

Sample output 4: 0

Comment: One city is okay just as it is.

• Sample input 5: 0001,0001,0001,1110 AfOj,fAcC,OcAP,jCPA AWFH,WAxU,FxAV,HUVA

Sample output 5: 0

Comment: We have four cities, which are connected in such a way that there is exactly one path

between each two cities.

Thus there is nothing to reconstruct.

4 Marking

Marking will be done automatically. The total mark is 10 (1 for compiling and 9 for 9 test cases).

5 Websubmission

You are asked to submit via the web interface https://cs.adelaide.edu.au/services/websubmission/.

The submission steps should be self-explanatory. Simply choose the correct semester, course, and assignment.

The websubmission system will automatically fetch the latest version of your work from your SVN repository

(you may also choose to submit older versions). Once your work is submitted, the system will launch a

script checking the format of your submission. Click “View Feedback” to view the results. Your mark will

be calculated offline after the deadline. You are welcome to resubmit for as many times as you wish (before

the deadline).

We will compile your code using g++ -o main.out -std=c++11 -O2 -Wall main.cpp. It is your responsibility to ensure that your code compiles on the university system.

1

1g++ has too many versions, so being able to compile on your laptop does not guarantee that it compiles on the university

system. You are encouraged to debug your code on a lab computer (or use SSH).

加QQ:99515681 或郵箱:99515681@qq.com   WX:codehelp

 

掃一掃在手機打開當前頁
  • 上一篇:代寫CMPT 125、c++設計編程代做
  • 下一篇:代寫CS170編程、代做Java程序設計
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 trae 豆包網頁版入口 目錄網 排行網

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

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    日韩精品一区二区三区高清_久久国产热这里只有精品8_天天做爽夜夜做爽_一本岛在免费一二三区

      <em id="rw4ev"></em>

        <tr id="rw4ev"></tr>

        <nav id="rw4ev"></nav>
        <strike id="rw4ev"><pre id="rw4ev"></pre></strike>
        国产原创一区二区| 国产一区二区三区黄| 久久国产精品网站| 国产精品网站视频| 国产精品videosex极品| 欧美日韩三级在线| 国模私拍视频一区| 亚洲欧美伊人| 久久网站热最新地址| 欧美亚洲日本一区| 国产日韩精品电影| 国内精品久久久久影院 日本资源| 欧美日韩美女在线观看| 香蕉亚洲视频| 亚洲高清久久| 国产精品国内视频| 国产香蕉久久精品综合网| 欧美日韩一区二区国产| 91久久精品国产91性色tv| 欧美午夜宅男影院| 美女脱光内衣内裤视频久久网站| 亚洲乱码国产乱码精品精可以看| 久久超碰97中文字幕| 国产亚洲亚洲| 在线看国产一区| 欧美午夜视频在线| 久久在精品线影院精品国产| 欧美日韩一区二区国产| 欧美区视频在线观看| 在线观看精品一区| 欧美日韩一区二区在线观看| 欧美午夜a级限制福利片| 性欧美videos另类喷潮| 久久综合伊人77777尤物| 亚洲少妇自拍| 欧美mv日韩mv国产网站| 精品51国产黑色丝袜高跟鞋| 国产欧美欧美| 国产亚洲免费的视频看| 亚洲国产另类精品专区| 国内精品模特av私拍在线观看| 妖精成人www高清在线观看| 韩国v欧美v日本v亚洲v| 亚洲一区图片| 在线日韩av永久免费观看| 欧美激情自拍| 国产精品国色综合久久| 亚洲午夜一区二区三区| 国产精品自拍网站| 国产色婷婷国产综合在线理论片a| 亚洲午夜视频| 一区二区三区精品在线| 国产精品r级在线| 国产亚洲精品久久久久动| 国产亚洲精品久久久久久| 欧美激情性爽国产精品17p| 亚洲国产一成人久久精品| 久久精品免费电影| 永久域名在线精品| 欧美在线日韩在线| 久久久久久久一区| 欧美精品一区二区三区很污很色的| 欧美日韩一区二| 欧美日韩视频免费播放| 国内自拍视频一区二区三区| 国产精品久久看| 国外成人在线视频| 欧美视频中文字幕在线| 国产精品超碰97尤物18| 亚洲精品一二三区| 亚洲国内欧美| 免费在线看成人av| 免费亚洲电影在线| 国产伦精品一区二区三区视频孕妇| 亚洲国产经典视频| 亚洲欧美成人| 亚洲国产一区二区三区a毛片| 亚洲精品自在在线观看| 国产精品婷婷午夜在线观看| 一区二区久久| 欧美精品日韩一区| 国产精品成人av性教育| 蜜桃久久精品一区二区| 在线看一区二区| 欧美成年人在线观看| 欧美日韩免费精品| 亚洲综合丁香| 欧美日本不卡视频| 欧美天堂亚洲电影院在线观看| 亚洲欧洲综合另类在线| 欧美不卡视频一区发布| 久久嫩草精品久久久精品| 国模叶桐国产精品一区| 国产片一区二区| 久久久久国产精品午夜一区| 久久av红桃一区二区小说| 国产一区二区三区四区三区四| 亚洲人成亚洲人成在线观看图片| 国产精品高潮呻吟久久| 亚洲精品一区二区三区福利| 久久久99久久精品女同性| 欧美视频一区二区三区| 欧美一级久久久| 欧美一区二区网站| 国内精品久久久久久影视8| 久久伊人精品天天| 一本色道精品久久一区二区三区| 在线不卡中文字幕| 国产精品va在线播放| 在线观看视频一区二区欧美日韩| 亚洲一区二区三区色| 亚洲一区二区三区精品动漫| 欧美国产视频一区二区| 在线看日韩av| 久久日韩粉嫩一区二区三区| 性一交一乱一区二区洋洋av| 欧美天堂亚洲电影院在线观看| 激情国产一区二区| 亚洲国产精品ⅴa在线观看| 亚洲视频香蕉人妖| 久久夜色精品国产欧美乱极品| 欧美日本韩国在线| 久久综合久久88| 亚洲视频在线视频| 午夜精品久久久久久久久| 怡红院av一区二区三区| 国产精品99久久久久久白浆小说| 亚洲日韩欧美视频一区| 亚洲欧洲精品一区二区精品久久久| 欧美日韩免费看| 亚洲欧洲精品成人久久奇米网| 国产日韩欧美在线一区| 久久精品123| 久久九九久精品国产免费直播| 国产精品日韩久久久| 一本色道久久| 日韩一二三在线视频播| 亚洲第一区色| 国产性做久久久久久| 欧美日韩在线精品一区二区三区| 欧美国产欧美亚洲国产日韩mv天天看完整| 欧美日韩亚洲一区二区三区在线| 最新国产の精品合集bt伙计| 欧美精品一二三| 久久久欧美一区二区| 国产美女扒开尿口久久久| 在线亚洲免费视频| 亚洲永久免费观看| 黄色成人av网| 国产精品久久久久久久久久久久| 中文有码久久| 一本大道久久a久久精二百| 亚洲婷婷综合色高清在线| 国产精品免费在线| 在线播放日韩欧美| 亚洲国产欧美一区| 亚洲小说春色综合另类电影| 亚洲自拍高清| 日韩视频免费| 精品1区2区3区4区| 国产一区在线观看视频| 日韩视频免费在线观看| 久久久人人人| 久久九九全国免费精品观看|