QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#674403#9101. Zayin and Busucup-team5071#Compile Error//C++201.4kb2024-10-25 15:35:332024-10-25 15:35:33

Judging History

你现在查看的是最新测评结果

  • [2024-10-25 15:35:33]
  • 评测
  • [2024-10-25 15:35:33]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
struct SSP{
    int cnt=1,hd[N],nxt[M<<1],to[M<<1],limit[M<<1],limit[M<<1],cst[M<<1];
    void init(){
        memset(hd,0,sizeof(hd));
        cnt=1;
    }
    void add(int u,int v,int w,int c){
        nxt[++cnt]=hd[u],hd[u]=cnt,to[cnt]=v,limit[cnt]=w,cst[cnt]=c;
        nxt[++cnt]=hd[v],hd[v]=cnt,to[cnt]=u,limit[cnt]=0,cst[cnt]=-c;
    }
    int fr[N],fl[N],in[N],dis[N];
    pair <int,int> min_cost(int s,int t){
        int flow=0,cost=0;
        while(true){
            queue<int> q;
            memset(dis,0x3f,sizeof(dis));
            memset(in,0,sizeof(in));
            fl[s]=1e9,dis[s]=0,q.push(s);
            while(!q.empty()){
                int cur=q.front();
                q.pop();in[cur]=0;
                for(int i=hd[cur];i;i=nxt[i]){
                    int it=to[i],d=dis[cur]+cst[i];
                    if(limit[i]&&d<dis[it]){
                        fl[it]=min(limit[i],fl[cur]),fr[it]=1,dis[it]=d;
                        if(!in[it])in[it]=1,q.push(it);
                    }
                }
            }
            if(dis[t]>1e9)return {flow,cost};
            flow+=fl[t],cost+=dis[t]*fl[t];
            for(int u=t;u!=s;u=to[fr[u]^1])limit[fr[u]]-=fl[t],limit[fr[u]^1]+=fl[t];
        }
    }
}Sol;
void Solve(){   
    
}
int main(){
    ios::sync_with_stdio(false),cin.tie(0);
    int T;
    cin>>T;
    while(T--)Solve();
    return 0;
}

詳細信息

answer.code:4:18: error: ‘N’ was not declared in this scope
    4 |     int cnt=1,hd[N],nxt[M<<1],to[M<<1],limit[M<<1],limit[M<<1],cst[M<<1];
      |                  ^
answer.code:4:25: error: ‘M’ was not declared in this scope
    4 |     int cnt=1,hd[N],nxt[M<<1],to[M<<1],limit[M<<1],limit[M<<1],cst[M<<1];
      |                         ^
answer.code:4:34: error: ‘M’ was not declared in this scope
    4 |     int cnt=1,hd[N],nxt[M<<1],to[M<<1],limit[M<<1],limit[M<<1],cst[M<<1];
      |                                  ^
answer.code:4:46: error: ‘M’ was not declared in this scope
    4 |     int cnt=1,hd[N],nxt[M<<1],to[M<<1],limit[M<<1],limit[M<<1],cst[M<<1];
      |                                              ^
answer.code:4:58: error: ‘M’ was not declared in this scope
    4 |     int cnt=1,hd[N],nxt[M<<1],to[M<<1],limit[M<<1],limit[M<<1],cst[M<<1];
      |                                                          ^
answer.code:4:68: error: ‘M’ was not declared in this scope
    4 |     int cnt=1,hd[N],nxt[M<<1],to[M<<1],limit[M<<1],limit[M<<1],cst[M<<1];
      |                                                                    ^
answer.code:13:12: error: ‘N’ was not declared in this scope
   13 |     int fr[N],fl[N],in[N],dis[N];
      |            ^
answer.code:13:18: error: ‘N’ was not declared in this scope
   13 |     int fr[N],fl[N],in[N],dis[N];
      |                  ^
answer.code:13:24: error: ‘N’ was not declared in this scope
   13 |     int fr[N],fl[N],in[N],dis[N];
      |                        ^
answer.code:13:31: error: ‘N’ was not declared in this scope
   13 |     int fr[N],fl[N],in[N],dis[N];
      |                               ^
answer.code: In member function ‘void SSP::init()’:
answer.code:6:16: error: ‘hd’ was not declared in this scope
    6 |         memset(hd,0,sizeof(hd));
      |                ^~
answer.code: In member function ‘void SSP::add(int, int, int, int)’:
answer.code:10:9: error: ‘nxt’ was not declared in this scope
   10 |         nxt[++cnt]=hd[u],hd[u]=cnt,to[cnt]=v,limit[cnt]=w,cst[cnt]=c;
      |         ^~~
answer.code:10:20: error: ‘hd’ was not declared in this scope
   10 |         nxt[++cnt]=hd[u],hd[u]=cnt,to[cnt]=v,limit[cnt]=w,cst[cnt]=c;
      |                    ^~
answer.code:10:36: error: ‘to’ was not declared in this scope; did you mean ‘tm’?
   10 |         nxt[++cnt]=hd[u],hd[u]=cnt,to[cnt]=v,limit[cnt]=w,cst[cnt]=c;
      |                                    ^~
      |                                    tm
answer.code:10:46: error: ‘limit’ was not declared in this scope
   10 |         nxt[++cnt]=hd[u],hd[u]=cnt,to[cnt]=v,limit[cnt]=w,cst[cnt]=c;
      |                                              ^~~~~
answer.code:10:59: error: ‘cst’ was not declared in this scope; did you mean ‘cnt’?
   10 |         nxt[++cnt]=hd[u],hd[u]=cnt,to[cnt]=v,limit[cnt]=w,cst[cnt]=c;
      |                                                           ^~~
      |                                                           cnt
answer.code: In member function ‘std::pair<int, int> SSP::min_cost(int, int)’:
answer.code:18:20: error: ‘dis’ was not declared in this scope; did you mean ‘div’?
   18 |             memset(dis,0x3f,sizeof(dis));
      |                    ^~~
      |                    div
answer.code:19:20: error: ‘in’ was not declared in this scope; did you mean ‘yn’?
   19 |             memset(in,0,sizeof(in));
      |                    ^~
      |                    yn
answer.code:20:13: error: ‘fl’ was not declared in this scope
   20 |             fl[s]=1e9,dis[s]=0,q.push(s);
      |             ^~
answer.code:24:27: error: ‘hd’ was not declared in this scope
   24 |                 for(int i=hd[cur];i;i=nxt[i]){
      |                           ^~
answer.code:24:39: error: ‘nxt’ was not declared in this scope
   24 |                 for(int i=hd[cur];i;i=nxt[i]){
      |                                       ^~~
answer.code:25:28: error: ‘to’ was not declared in this scope; did you mean ‘tm’?
   25 |                     int it=to[i],d=dis[cur]+cst[i];
      |                            ^~
      |                            tm
answer.code:26:24: error: ‘limit’ was not declared in this scope
   26 |                     if(limit[i]&&d<dis[it]){
      |                        ^~~~~
answer.code:26:34: error: ‘d’ was not declared in this scope
   26 |                     if(limit[i]&&d<dis[it]){
      |                                  ^
answer.code:27:54: error: ‘fr’ was not declared in this scope
   27 |                         fl[it]=min(limit[i],fl[cur]),fr[it]=1,dis[it]=d;
      |                                                      ^~
answer.code:34:32: error: ‘to’ was not declared in this scope; did you mean ‘tm’?
   34 |             for(int u=t;u!=s;u=to[fr[u]^1])limit[fr[u]]-=fl[t],limit[fr[u]^1]+=fl[t];
      |                                ^~
      |                                tm
answer.code:34:35: error: ‘fr’ was not declared in this scope...