日韩精品一区二区三区高清_久久国产热这里只有精品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>
        国产精品午夜国产小视频| 国产精品户外野外| 在线观看精品一区| 亚洲少妇一区| 久久夜色精品一区| 日韩亚洲精品视频| 在线电影欧美日韩一区二区私密| 欧美日韩国产探花| 女女同性女同一区二区三区91| 久久精品国产视频| 国产精品一区2区| 欧美激情一区二区三区蜜桃视频| 久久亚洲午夜电影| 国产精品美女视频网站| 欧美激情视频一区二区三区免费| 亚洲人成人一区二区三区| 欧美精品一区二区三区在线播放| 麻豆精品一区二区av白丝在线| 欧美视频一区二区三区在线观看| 一区二区三区回区在观看免费视频| 久久精品在这里| 韩国av一区二区三区| 国产精品高潮呻吟久久av无限| 亚洲美女av电影| 麻豆av一区二区三区| 99精品视频网| 一本色道久久88综合亚洲精品ⅰ| 国产精品久久| 欧美一级久久久久久久大片| 精品成人一区| 艳妇臀荡乳欲伦亚洲一区| 性欧美videos另类喷潮| 红桃视频一区| 国产在线播放一区二区三区| 久久久久国色av免费观看性色| 亚洲精品一区二区三区蜜桃久| 欧美激情亚洲自拍| 老妇喷水一区二区三区| 欧美一区二区三区四区在线观看地址| 日韩视频二区| 亚洲综合导航| 久久久一区二区三区| 国产日韩欧美综合精品| 久久久精品一品道一区| 日韩一二三区视频| 欧美三级电影精品| 久久精品一区四区| 欧美视频在线观看一区| 好吊妞这里只有精品| 美玉足脚交一区二区三区图片| 国产精品久久久久免费a∨大胸| 欧美日韩国产成人在线91| 亚洲久色影视| 免费观看不卡av| 国产精品第一页第二页第三页| 欧美成人日韩| 久久一区二区三区国产精品| 夜夜嗨av一区二区三区四季av| 国产日韩欧美一区二区三区四区| 一区二区三区欧美激情| 亚洲国产高清自拍| 国产精品自拍一区| 亚洲人成在线免费观看| 亚洲精一区二区三区| 欧美一区二区三区在| aa日韩免费精品视频一| 亚洲每日更新| 亚洲国产免费| 亚洲午夜精品一区二区| 亚洲精品乱码久久久久久黑人| 久久国产成人| 久久夜色精品国产| 亚洲精品综合在线| 久久精品国产第一区二区三区最新章节| 久久夜色精品国产亚洲aⅴ| 免费观看成人www动漫视频| 欧美日韩精品免费观看| 国产精品一区一区三区| 欧美顶级艳妇交换群宴| 亚洲欧美在线高清| 国产精品视频不卡| 亚洲免费观看在线视频| 欧美.日韩.国产.一区.二区| 国产精品亚洲а∨天堂免在线| 久久久久久久综合日本| 国产色综合久久| 亚洲毛片视频| 欧美日韩综合视频| 亚洲欧美日韩成人高清在线一区| 久久久久久久999| 欧美日韩在线播放三区四区| 欧美在线视频一区二区三区| 欧美三级免费| 亚洲一区二区三区四区在线观看| 玖玖视频精品| 久久久99免费视频| 欧美日韩亚洲免费| 国产精品永久免费观看| 国产精品v亚洲精品v日韩精品| 欧美ed2k| 国产精品稀缺呦系列在线| 国产精品久久久久久久久婷婷| 在线看不卡av| 免费久久99精品国产| 亚洲欧美国产精品桃花| 欧美黄色影院| 国产精品一区=区| 91久久香蕉国产日韩欧美9色| 免费观看日韩av| 一本久久综合亚洲鲁鲁五月天| 久久精品国产免费看久久精品| 在线看片欧美| 欧美日本亚洲| 黄色日韩网站| 欧美性猛交一区二区三区精品| 一区二区激情小说| 国产乱码精品一区二区三区忘忧草| 久久九九热re6这里有精品| 久久爱www久久做| 午夜伦理片一区| 亚洲黄色尤物视频| 国产一区久久久| 黄网站免费久久| 国产精品一区在线播放| 欧美视频专区一二在线观看| 国产精品美女一区二区在线观看| 国产精品免费电影| 欧美精品 日韩| 亚洲人成77777在线观看网| 一本一本久久a久久精品综合妖精| 麻豆免费精品视频| 久久免费国产精品1| 欧美日韩中文字幕综合视频| 在线观看日韩国产| 亚洲欧洲一区二区在线播放| 99精品99久久久久久宅男| 日韩亚洲欧美一区| 黑人一区二区| 美女脱光内衣内裤视频久久影院| 欧美日本精品在线| 久久国产欧美| 亚洲人成网站在线播| 亚洲欧美在线磁力| 狠狠色丁香婷综合久久| 久久狠狠婷婷| 亚洲精品美女| 国产精品手机视频| 亚洲愉拍自拍另类高清精品| 午夜精品视频一区| 久久精品二区| 国产精品久久久久久一区二区三区| 久久综合影视| 在线精品亚洲一区二区| 欧美激情国产高清| 亚洲欧美日韩精品综合在线观看| 午夜精品福利在线观看| 欧美一区二区视频在线| 国产嫩草一区二区三区在线观看| 欧美黄色精品| 性欧美videos另类喷潮| 最新日韩在线| 可以看av的网站久久看| 久久久久网址| 欧美精品少妇一区二区三区|