老田用的弗洛伊德 我觉得我的快一点..不知道叫啥算法 无招胜有招了 (墨镜)
每个人身上两种属性 传到他需要的时间(int time)以及他是否往下传播(bool set)
unit向他的contact传播 => contact.time=unit.settime
[contact](传播到此contact所需时间)+unit.time
1.开始选择的人start, start.set=true
2.扫描所有的unit, 如果set==true则对他的每一个contact判断, 若contact.time>unit.time+unit.setting(contact), 则用这个较快的time赋值,并且contact.set=true, 下一轮用新的time传播给这个contact的contact们
3.重复2知道所有unit.set==false为止
4.判断是否有unit没有触及到
[cpp]#include <cstdio>
typedef struct unit {
int num;
int contact[99];
int settime[99];
bool set;
int time;
} Unit;
typedef struct aa {
int start;
int time;
} Result;
void calc();
int search();
Unit a[101];
Result x,result;
int n;
int main() {
int i,j,start;
scanf("%d",&n);
while(n) {
for(i=1;i<=n;i++) {
scanf("%d",&a[i].num);
for(j=0;j<a[i].num;j++)
scanf("%d%d",&a[i].contact[j],&a[i].settime[j]);
}
result.start=-1;
for(start=1;start<=n;start++) {
for(i=1;i<=n;i++) {
a[i].set=false;
a[i].time=-1;
}
a[start].set=true;
a[start].time=0;
i=0;
while(i<n+1) {
calc();
for(i=1;i<=n;i++)
if(a[i].set==true)
break;
}
x.time=search();
x.start=start;
for(i=1;i<=n;i++)
if(a[i].time==-1) {
x.start=-1;
break;
}
if(x.start==-1)
continue;
if(x.time<result.time||result.start==-1)
result=x;
}
if(result.start==-1)
if(n==0)
printf("0 0\n");
else
printf("disjoint\n");
else
printf("%d %d\n",result.start,result.time);
scanf("%d",&n);
}
return 0;
}
void calc() {
int i,j,spreadtime;
for(i=1;i<=n;i++)
if(a[i].set) {
for(j=0;j<a[i].num;j++) {
spreadtime=a[i].time+a[i].settime[j];
if(a[a[i].contact[j]].time>spreadtime||a[a[i].contact[j]].time==-1) {
a[a[i].contact[j]].time=spreadtime;
a[a[i].contact[j]].set=true;
}
}
a[i].set=false;
}
}
int search() {
int max,i;
max=a[1].time;
for(i=2;i<=n;i++)
if(a[i].time>max)
max=a[i].time;
return max;
}
[/cpp]
References:
Monro Casino VIP https://calendly.com/url?q=https%3A%2F%2Fshort.turtle.onl%2Fivaveh92369312
References:
Hit n spin casino no deposit bonus http://www.drforhair.co.kr
References:
Hitnspin promo code http://zanostroy.ru/go?url=https://www.haphong.edu.vn/profile/mccluresxmlillelund65483/profilehttp://zanostroy.ru/go?url=https://www.haphong.edu.vn/profile/mccluresxmlillelund65483/profile</a
References:
Hitnspin casino paysafecard forum.truck.ru
References:
Hit n spin no deposit bonus https://www.kaskus.co.id/redirect?url=http://dobson-phelps-2.federatedjournals.com/hitnspin-hitnspin-casino-offizielle-seite-bonus-800-200-freispiele-1781956369
References:
Hitnspin freispiele https://utmagazine.ru/r?url=karayaz.ru/user/epochtuba00/
References:
Hit n spin bewertung http://abonents-ntvplus.ru/
References:
Hitnspin casino aktionscode lists.princeton.edu
References:
Lollybet Registrierung nl.thefreedictionary.com
References:
Lollybet Casino App Download http://cse.google.ci/url?sa=t&url=http://smartcampus-seskoal.id/streaming/@shaynelebron21?page=about
References:
Lollybet Casino Paysafecard images.google.pn
References:
Lollybet Casino Bonusbedingungen faktor-info.ru
References:
Lollybet Casino Live Dealer http://images.google.com.bd/url?sa=t&url=http://mycrewdate.com/@paigetmf093700
References:
Hitnspin willkommensbonus aktsh.ru
References:
Hit’n spin casino http://clients1.google.com.sa/
References:
Hitnspin casino promo code http://cse.google.com.ai/
References:
Hitnspin casino alternative http://cse.google.cat
References:
Hitnspin casino gutscheincode images.google.co.ma
References:
Hit n spin bewertung http://cse.google.iq/
References:
Hitnspin casino ähnliche casinos cgi.2chan.net
References:
Hitnspin casino no deposit bonus image.google.com.af
References:
Hitnspin casino spielautomaten http://hezuo.xcar.com.cn/index.php?partner=weixin_share&conv=0&url=https://dailyfantasyrankings.com.au/public/forum/user-220431.html
References:
Payid pokies online https://gitea.gcras.ru/shayashley5481
References:
Instant payid pokies australia ophot.net
References:
New payid pokies https://streamifyr.com/@crystaldoss762?page=about
References:
Payid online pokies https://trust-employement.com/employer/payid-withdrawal-pokies-australia-2026-instant-pay/
References:
Online pokies australia payid real money https://git.pelote.chat/stacyberman69
References:
Online pokies with payid australia real money https://ophot.net/bbs/board.php?bo_table=notice&wr_id=85561
References:
Instant payid pokies australia https://gitbaz.ir/luciennehursey
References:
Payid online pokies australia https://jobs.khtp.com.my/employer/79103/best-payid-slots-australia-2026-instant-deposit/
References:
Australian online pokies payid https://husseinmirzaki.ir/cindicarnarvon
References:
Payid pokies instant withdrawal https://jobcopusa.com/employer/adyen-fintech-platform-for-enterprises/
References:
Australian online pokies payid https://git.lenfortech.com/jaredthomsen1
References:
Australian online pokies payid https://bbclinic-kr.com:443/nose/nation/bbs/board.php?bo_table=E05_4&wr_id=1029121
References:
Lollybet Casino Blackjack http://cse.google.bj/url?sa=t&url=https://sht-link.com/carmineygd061
References:
Lollybet Casino No Deposit https://www.unifrance.org/newsletter-click/6763261?url=https://link.botam.my.id/lenac592714129
References:
Lollybet Bewertung http://optimize.viglink.com/page/pmv?url=https://link.1hut.ru/jonellefreed8
References:
Lollybet Casino 10 Euro Bonus http://toolbarqueries.google.co.ug/url?sa=t&url=https://unim.ma/cameronapel720
References:
Lollybet Casino https://89.cholteth.com/index/d1?diff=0&utm_source=ogdd&utm_campaign=26607&utm_content=&utm_clickid=g00w000go8sgcg0k&aurl=https://l2l.li/bryantfyans475
References:
Lollybet Bonus http://images.google.co.uz/url?source=imgres&ct=img&q=https://link.mym.ge/chasterrill70
References:
Lollybet Casino Auszahlungsdauer http://www.google.com.pg/url?sa=t&url=https://urladda.com/jamalmeans8798/
References:
Lollybet Casino mit Echtgeld https://scienceplus.abes.fr/describe/?url=https://csvip.win/doramacdermott
References:
Lollybet Auszahlung http://images.google.az/url?sa=t&url=https://de2wa.com/georgiannarums
References:
Lollybet Bonus ohne Einzahlung https://maps.google.ci/url?sa=t&url=https://mylinkbox.me/christiana
References:
Lollybet Mobile Casino https://galeapps.gale.com/apps/auth?userGroupName=los42754&origURL=https://lollybet.com.de/
References:
Lollybet Casino Paysafecard https://zooshans.by/registration/?redirect_url=https://lollybet.com.de/
References:
Lollybet Registrierung http://clients1.google.vg/url?q=https://biolinksapp.com/inezpurser
References:
Lollybet Deutschland Login https://wiki.weizmann.ac.il/playgo/api.php?action=https://biolink.belfiusolucoes.com.br/paulahailey524
References:
Lollybet Casino Treueprogramm https://maps.google.tk/url?q=https://sosi.al/sherryl25g0740
References:
Lollybet No Deposit Bonus https://blagomedtaxi.ru:443/ssylki/l.php?link=https://linknest.vip/bethsalmond74