Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
边的起始值设置为0,导致调了n久,faintint k = 1; for(int i = 0; i < n; ++i) { scanf("%d %d %d", &a, &b, &c); G[k].w = c; G[k].end = b+1; G[k].next = first[a]; first[a] = k++; if(outset > a) outset = a; if(destination < b+1) destination = b+1; } for(int i = outset+1; i <= destination; ++i) { G[k].w = 0; G[k].end = i; G[k].next = first[i-1]; first[i-1] = k++; G[k].w = -1; G[k].end = i-1; G[k].next = first[i]; first[i] = k++; } k值一开始设置为0,和first数组的值一样,导致覆盖掉了一些边,哎。 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator