亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 學院 > 開發設計 > 正文

uva 11463 Commandos

2019-11-11 03:37:03
字體:
來源:轉載
供稿:網友

A group of commandos were assigned a critical task. They are to destroy an enemy head quarter. The enemy head quarter consists of several buildings and the buildings are connected by roads. The commandos must visit each building and place a bomb at the base of each building. They start their mission at the base of a particular building and from there they disseminate to reach each building. The commandos must use the available roads to travel between buildings. Any of them can visit one building after another, but they must all gather at a common place when their task in done. In this PRoblem, you will be given the description of different enemy headquarters. Your job is to determine the minimum time needed to complete the mission. Each commando takes exactly one unit of time to move between buildings. You may assume that the time required to place a bomb is negligible. Each commando can carry unlimited number of bombs and there is an unlimited supply of commando troops for the mission.

Input Input starts with an integer T (≤50), denoting the number of test cases.

The first line of each case starts with a positive integer N (1 ≤ N ≤ 100), where N denotes the number of buildings in the head quarter. The next line contains a positive integer R, where R is the number of roads connecting two buildings. Each of the next R lines contain two distinct numbers u v (0 ≤ u, v < N), this means there is a road connecting building u to building v. The buildings are numbered from 0 to N-1. The last line of each case contains two integers s d (0 ≤ s, d < N). Where s denotes the building from where the mission starts and d denotes the building where they must meet. You may assume that two buildings will be directly connected by at most one road. The input will be given such that, it will be possible to go from any building to another by using one or more roads.

Output For each case, print the case number and the minimum time required to complete the mission.

Sample Input 2 4 3 0 1 2 1 1 3 0 3 2 1 0 1 1 0 Sample Output Case 1: 4 Case 2: 1

題目:有一個敢死隊,要摧毀一群建筑,他們從一個特定的建筑出發,最后到一個特定的建筑集合;

現在給你各個建筑之間的連接路線,在建筑中穿梭需要1個單位時間,問集合的最早時間。

分析:圖論,最短路徑。直接計算起點s和終點e到那個其他所有點的最短路徑; floyd比較簡單 也可以用兩個dijk 因為數據小。

#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <cmath>using namespace std;const int maxn = 101000;#define inf 0x3f3f3f3fint d[200];int s[200];int e[200][200];int main(){ int t; cin>>t; int cc=1; while(t--) { int n,m; cin>>n>>m; memset(e,0x3f,sizeof(e)); for(int i=0;i<n;i++) { for(int j=0;j<n;j++) e[i][j]=inf; e[i][i]=0; } for(int i=0;i<m;i++) { int a,b; cin>>a>>b; e[a][b]=1; e[b][a]=1; } int si,di; cin>>si>>di; for(int i=0;i<n;i++) for(int j=0;j<n;j++) for(int k=0;k<n;k++) { if(e[j][k]>e[j][i]+e[i][k]) e[j][k]=e[j][i]+e[i][k]; } int maxx=0; for(int i=0;i<n;i++) maxx=max(e[si][i]+e[i][di],maxx); printf("Case %d: %d/n",cc++,maxx); }}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
欧美小视频在线观看| 色老头一区二区三区在线观看| 91久久久久久久久久| 国模极品一区二区三区| 亚洲欧美制服另类日韩| 亚洲欧美成人一区二区在线电影| 久久精品视频中文字幕| 日韩不卡中文字幕| 成人a在线视频| 国产精品女人久久久久久| 揄拍成人国产精品视频| 成人免费福利视频| 日韩亚洲在线观看| 午夜精品久久久久久久白皮肤| 国产美女搞久久| 91高清免费视频| 亲爱的老师9免费观看全集电视剧| 久久这里有精品视频| 亚洲跨种族黑人xxx| 91久久精品久久国产性色也91| 亚洲天堂免费观看| 欧美三级免费观看| 亚洲欧洲一区二区三区在线观看| 欧美亚洲在线播放| 国产精品69精品一区二区三区| www.国产一区| 亚洲人av在线影院| 欧美视频不卡中文| 777午夜精品福利在线观看| 色久欧美在线视频观看| 国内精品久久久久久中文字幕| 国产精品一二区| 久久6免费高清热精品| 国产精品免费在线免费| 影音先锋日韩有码| 欧美成人黄色小视频| 成人久久久久爱| 91免费看片在线| 成人a在线观看| 国产69精品久久久久99| 精品一区电影国产| 欧美极品美女视频网站在线观看免费| 97人人模人人爽人人喊中文字| 夜夜嗨av一区二区三区四区| 91视频-88av| 亚洲欧美日韩中文视频| 久久精品国产v日韩v亚洲| 亚洲综合中文字幕在线观看| 亚洲精品网站在线播放gif| 性色av一区二区三区红粉影视| 亚洲一区二区久久久久久久| 欧美人与性动交a欧美精品| 久久五月情影视| 亚洲天堂男人的天堂| 国产大片精品免费永久看nba| 国产精品国语对白| 午夜剧场成人观在线视频免费观看| 亚洲电影免费观看高清| 午夜精品福利视频| 色偷偷9999www| 久久久久国产精品www| 91色精品视频在线| 色婷婷久久av| 久久成人18免费网站| 成人高h视频在线| 久久国产精品久久国产精品| 成人性生交xxxxx网站| 午夜精品福利在线观看| 国产精品视频一区二区三区四| 成人免费观看49www在线观看| 国产91精品视频在线观看| 欧美国产在线视频| 亚洲国产一区二区三区在线观看| 亚洲毛茸茸少妇高潮呻吟| 国产精品人成电影| 亚洲人成网站色ww在线| 亚洲欧美激情精品一区二区| 欧美性感美女h网站在线观看免费| 一区二区三区国产在线观看| 欧美成在线视频| 91精品视频在线免费观看| 亚洲视频在线观看视频| 国产精品jvid在线观看蜜臀| 欧美成人性色生活仑片| 国产日韩欧美视频在线| 国产精品成av人在线视午夜片| 成年无码av片在线| 久久久国产精彩视频美女艺术照福利| 亚洲黄色av女优在线观看| 在线视频欧美日韩| 日韩中文字幕免费看| 日韩电影中文字幕av| 国产精品久久久久久久久男| 亚洲美女在线视频| 欧美高清视频一区二区| 国产精品美女在线| 青青草成人在线| 国产在线精品一区免费香蕉| 91免费人成网站在线观看18| 日本久久久久久久久| 亚洲成人激情在线| 亚洲一区二区三区香蕉| 91在线|亚洲| 亚洲黄色在线看| 91精品在线观| 日韩电影第一页| 国产精品人成电影| 日韩免费黄色av| 日韩经典中文字幕在线观看| 成人亚洲欧美一区二区三区| 亚洲国产精品高清久久久| 在线成人激情黄色| 国产欧美日韩最新| 精品综合久久久久久97| 亚洲美女视频网站| 青青a在线精品免费观看| 亚洲欧洲在线免费| 91免费看片网站| 日韩国产一区三区| 精品视频一区在线视频| 国产成人在线精品| 精品伊人久久97| 国外成人在线播放| 国产精品jizz在线观看麻豆| 91精品国产乱码久久久久久蜜臀| 日本久久91av| 久久国产精品久久久久久| 最近2019中文字幕第三页视频| 国产精品日韩欧美大师| 欧美日本亚洲视频| 国产成人精品999| 亚洲国产天堂久久综合网| 久久国产精品久久精品| 91社影院在线观看| 色噜噜狠狠狠综合曰曰曰| 韩国精品久久久999| 亚洲国产中文字幕在线观看| 国产精品7m视频| 中文字幕日韩专区| 青草成人免费视频| 亚洲激情视频在线| 亚洲高清不卡av| 97婷婷涩涩精品一区| 亚洲国产欧美在线成人app| 国产精品一区久久| 91超碰中文字幕久久精品| 正在播放欧美一区| 亚洲va欧美va在线观看| 91人成网站www| 全亚洲最色的网站在线观看| 亚洲精品成a人在线观看| 亚洲欧美国产高清va在线播| 一区二区三区四区精品| 欧美午夜精品久久久久久久| 久久视频在线看| 久久不射热爱视频精品| 国产精品视频yy9099| 亚洲精品99久久久久| 成人黄色av免费在线观看| 国产精品久久久| 精品国偷自产在线视频99| 亚洲美女动态图120秒| 亚洲小视频在线| 最近2019中文字幕一页二页|