QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#68719 | #4152. 工作安排 | MaMengQi | Compile Error | / | / | C++ | 1.4kb | 2022-12-19 03:26:24 | 2022-12-19 03:26:25 |
Due to the privacy settings of the submitter, you are not allowed to view this code.
詳細信息
answer.code:1:18: warning: extra tokens at end of #include directive 1 | #include<cstdio> #include<cstring> #include<iostream> using namespace std; const int N=25100,inf=100000000; struct ee{int to,next,f,w;}e[N*20]; int S,T,cnt=1,n,k,timer,m,u,v,w; long long ans; int head[N],dis[N],pre[N],q[N],s[N]; bool inq[N]; void ins(int u,int v,int f,int w){ e[++cnt].to=v,e[cnt].next=head[u],e[cnt].f=f,e[cnt].w=w,head[u]=cnt; e[++cnt].to=u,e[cnt].next=head[v],e[cnt].f=0,e[cnt].w=-w,head[v]=cnt; } bool spfa(){ for (int i=1;i<=T;i++) dis[i]=inf; int h=0,t=1; q[t]=S;dis[S]=0;inq[S]=1; while (h!=t){ int now=q[++h];if(h==T) h=0; for (int i=head[now];i;i=e[i].next){ int v=e[i].to; if (dis[v]>dis[now]+e[i].w&&e[i].f){ dis[v]=dis[now]+e[i].w; pre[v]=i; if (!inq[v]){ q[++t]=v;if (t==T) t=0; inq[v]=1; } } } inq[now]=0; } if (dis[T]==inf) return 0; return 1; } void updata(){ int tmp=T,flow=inf; while (tmp!=S){ int l=pre[tmp],v=e[l].to; flow=min(flow,e[l].f); tmp=e[l^1].to; } tmp=T; while (tmp!=S){ int l=pre[tmp],v=e[l].to; e[l].f-=flow;e[l^1].f+=flow; tmp=e[l^1].to; } ans+=dis[T]*flow; } int main(){ scanf("%d%d",&m,&n); T=1005;int c,a,x; for(int i=1;i<=n;i++) { scanf("%d",&c); ins(S,i,c,0);//???????????? } for(int i=1;i<=m;i++) for(int j=1;j<=n;j++){ scanf("%d",&a); if(a) ins(j,i+n,inf,0); } for(int i=1+n;i<=m+n;i++){ scanf("%d",&x); for(int j=1;j<=x;j++) scanf("%d",&s[j]); s[x+1]=inf; for(int j=1;j<=x+1;j++) { scanf("%d",&w); ins(i,T,s[j]-s[j-1],w); } } while(spfa()) updata(); printf("%lld",ans); } | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x24): undefined reference to `main' collect2: error: ld returned 1 exit status