0_0_20614380_30792.cpp:8:5: error: 'point' does not name a type
point[N];int n,m,k; void addedge(int u,int v,int w){ Cedge[tot].u=u; Cedge[tot].v=v; Cedge[tot].w=w; tot++;} void Push_into(int p,Point t){ point[p].push_back(t);} bool cmp(Point a,Point b){ if(a.lw==b.lw) return a.alw>b.alw; return a.lw<b.lw;} int main(){ int T,u,v,w,sz; scanf("%d",&T); while(T--){ scanf("%d%d%d",&n,&m,&k); tot=0; for(int i=1;i<=n;i++){ point[i].clear(); } for(int i=1;i<=m;i++){ scanf("%d%d%d",&u,&v,&w); addedge(u,v,w); } sort(Cedge,Cedge+tot); for(int i=0;i<tot;i++){ u=Cedge[i].u; v=Cedge[i].v; if(u==1){ if(point[v].empty()){ Push_into(v,Point(Cedge[i].w,Cedge[i].w)); } else{ if(point[v][point[v].size()-1].alw>Cedge[i].w){ Push_into(v,Point(Cedge[i].w,Cedge[i].w)); } } continue; } if(point[u].empty()) continue; else { int p=upper_bound(point[u].begin(),point[u].end(),Point(Cedge[i].w-k,-INF),cmp)-point[u].begin(); if(p==0) continue; else if(p>0 && p<point[u].size()) --p; else if(point[u][point[u].size()-1].lw<=Cedge[i].w-k) p=point[u].size()-1; else continue; if(point[v].empty()) Push_into(v,Point(Cedge[i].w,point[u][p].alw+(LL)Cedge[i].w)); else if(point[v][point[v].size()-1].alw>point[u][p].alw+(LL)Cedge[i].w) Push_into(v,Point(Cedge[i].w,point[u][p].alw+(LL)Cedge[i].w)); } } if(point[n].empty()) printf("-1\n"); else printf("%I64d\n",point[n][point[n].size()-1].alw); } return 0;}
^
0_0_20614380_30792.cpp: In function 'void addedge(int, int, int)':
0_0_20614380_30792.cpp:8:61: error: 'Cedge' was not declared in this scope
point[N];int n,m,k; void addedge(int u,int v,int w){ Cedge[tot].u=u; Cedge[tot].v=v; Cedge[tot].w=w; tot++;} void Push_into(int p,Point t){ point[p].push_back(t);} bool cmp(Point a,Point b){ if(a.lw==b.lw) return a.alw>b.alw; return a.lw<b.lw;} int main(){ int T,u,v,w,sz; scanf("%d",&T); while(T--){ scanf("%d%d%d",&n,&m,&k); tot=0; for(int i=1;i<=n;i++){ point[i].clear(); } for(int i=1;i<=m;i++){ scanf("%d%d%d",&u,&v,&w); addedge(u,v,w); } sort(Cedge,Cedge+tot); for(int i=0;i<tot;i++){ u=Cedge[i].u; v=Cedge[i].v; if(u==1){ if(point[v].empty()){ Push_into(v,Point(Cedge[i].w,Cedge[i].w)); } else{ if(point[v][point[v].size()-1].alw>Cedge[i].w){ Push_into(v,Point(Cedge[i].w,Cedge[i].w)); } } continue; } if(point[u].empty()) continue; else { int p=upper_bound(point[u].begin(),point[u].end(),Point(Cedge[i].w-k,-INF),cmp)-point[u].begin(); if(p==0) continue; else if(p>0 && p<point[u].size()) --p; else if(point[u][point[u].size()-1].lw<=Cedge[i].w-k) p=point[u].size()-1; else continue; if(point[v].empty()) Push_into(v,Point(Cedge[i].w,point[u][p].alw+(LL)Cedge[i].w)); else if(point[v][point[v].size()-1].alw>point[u][p].alw+(LL)Cedge[i].w) Push_into(v,Point(Cedge[i].w,point[u][p].alw+(LL)Cedge[i].w)); } } if(point[n].empty()) printf("-1\n"); else printf("%I64d\n",point[n][point[n].size()-1].alw); } return 0;}
^
0_0_20614380_30792.cpp:8:67: error: 'tot' was not declared in this scope
point[N];int n,m,k; void addedge(int u,int v,int w){ Cedge[tot].u=u; Cedge[tot].v=v; Cedge[tot].w=w; tot++;} void Push_into(int p,Point t){ point[p].push_back(t);} bool cmp(Point a,Point b){ if(a.lw==b.lw) return a.alw>b.alw; return a.lw<b.lw;} int main(){ int T,u,v,w,sz; scanf("%d",&T); while(T--){ scanf("%d%d%d",&n,&m,&k); tot=0; for(int i=1;i<=n;i++){ point[i].clear(); } for(int i=1;i<=m;i++){ scanf("%d%d%d",&u,&v,&w); addedge(u,v,w); } sort(Cedge,Cedge+tot); for(int i=0;i<tot;i++){ u=Cedge[i].u; v=Cedge[i].v; if(u==1){ if(point[v].empty()){ Push_into(v,Point(Cedge[i].w,Cedge[i].w)); } else{ if(point[v][point[v].size()-1].alw>Cedge[i].w){ Push_into(v,Point(Cedge[i].w,Cedge[i].w)); } } continue; } if(point[u].empty()) continue; else { int p=upper_bound(point[u].begin(),point[u].end(),Point(Cedge[i].w-k,-INF),cmp)-point[u].begin(); if(p==0) continue; else if(p>0 && p<point[u].size()) --p; else if(point[u][point[u].size()-1].lw<=Cedge[i].w-k) p=point[u].size()-1; else continue; if(point[v].empty()) Push_into(v,Point(Cedge[i].w,point[u][p].alw+(LL)Cedge[i].w)); else if(point[v][point[v].size()-1].alw>point[u][p].alw+(LL)Cedge[i].w) Push_into(v,Point(Cedge[i].w,point[u][p].alw+(LL)Cedge[i].w)); } } if(point[n].empty()) printf("-1\n"); else printf("%I64d\n",point[n][point[n].size()-1].alw); } return 0;}
^
0_0_20614380_30792.cpp: At global scope:
0_0_20614380_30792.cpp:8:147: error: 'Point' has not been declared
point[N];int n,m,k; void addedge(int u,int v,int w){ Cedge[tot].u=u; Cedge[tot].v=v; Cedge[tot].w=w; tot++;} void Push_into(int p,Point t){ point[p].push_back(t);} bool cmp(Point a,Point b){ if(a.lw==b.lw) return a.alw>b.alw; return a.lw<b.lw;} int main(){ int T,u,v,w,sz; scanf("%d",&T); while(T--){ scanf("%d%d%d",&n,&m,&k); tot=0; for(int i=1;i<=n;i++){ point[i].clear(); } for(int i=1;i<=m;i++){ scanf("%d%d%d",&u,&v,&w); addedge(u,v,w); } sort(Cedge,Cedge+tot); for(int i=0;i<tot;i++){ u=Cedge[i].u; v=Cedge[i].v; if(u==1){ if(point[v].empty()){ Push_into(v,Point(Cedge[i].w,Cedge[i].w)); } else{ if(point[v][point[v].size()-1].alw>Cedge[i].w){ Push_into(v,Point(Cedge[i].w,Cedge[i].w)); } } continue; } if(point[u].empty()) continue; else { int p=upper_bound(point[u].begin(),point[u].end(),Point(Cedge[i].w-k,-INF),cmp)-point[u].begin(); if(p==0) continue; else if(p>0 && p<point[u].size()) --p; else if(point[u][point[u].size()-1].lw<=Cedge[i].w-k) p=point[u].size()-1; else continue; if(point[v].empty()) Push_into(v,Point(Cedge[i].w,point[u][p].alw+(LL)Cedge[i].w)); else if(point[v][point[v].size()-1].alw>point[u][p].alw+(LL)Cedge[i].w) Push_into(v,Point(Cedge[i].w,point[u][p].alw+(LL)Cedge[i].w)); } } if(point[n].empty()) printf("-1\n"); else printf("%I64d\n",point[n][point[n].size()-1].alw); } return 0;}
^
0_0_20614380_30792.cpp: In function 'void Push_into(int, int)':
0_0_20614380_30792.cpp:8:160: error: 'point' was not declared in this scope
point[N];int n,m,k; void addedge(int u,int v,int w){ Cedge[tot].u=u; Cedge[tot].v=v; Cedge[tot].w=w; tot++;} void Push_into(int p,Point t){ point[p].push_back(t);} bool cmp(Point a,Point b){ if(a.lw==b.lw) return a.alw>b.alw; return a.lw<b.lw;} int main(){ int T,u,v,w,sz; scanf("%d",&T); while(T--){ scanf("%d%d%d",&n,&m,&k); tot=0; for(int i=1;i<=n;i++){ point[i].clear(); } for(int i=1;i<=m;i++){ scanf("%d%d%d",&u,&v,&w); addedge(u,v,w); } sort(Cedge,Cedge+tot); for(int i=0;i<tot;i++){ u=Cedge[i].u; v=Cedge[i].v; if(u==1){ if(point[v].empty()){ Push_into(v,Point(Cedge[i].w,Cedge[i].w)); } else{ if(point[v][point[v].size()-1].alw>Cedge[i].w){ Push_into(v,Point(Cedge[i].w,Cedge[i].w)); } } continue; } if(point[u].empty()) continue; else { int p=upper_bound(point[u].begin(),point[u].end(),Point(Cedge[i].w-k,-INF),cmp)-point[u].begin(); if(p==0) continue; else if(p>0 && p<point[u].size()) --p; else if(point[u][point[u].size()-1].lw<=Cedge[i].w-k) p=point[u].size()-1; else continue; if(point[v].empty()) Push_into(v,Point(Cedge[i].w,point[u][p].alw+(LL)Cedge[i].w)); else if(point[v][point[v].size()-1].alw>point[u][p].alw+(LL)Cedge[i].w) Push_into(v,Point(Cedge[i].w,point[u][p].alw+(LL)Cedge[i].w)); } } if(point[n].empty()) printf("-1\n"); else printf("%I64d\n",point[n][point[n].size()-1].alw); } return 0;}
|