QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#606266#8939. Permutationucup-team3646#Compile Error//C++201.6kb2024-10-03 00:02:522024-10-03 00:02:53

Judging History

This is the latest submission verdict.

  • [2024-10-03 00:02:53]
  • Judged
  • [2024-10-03 00:02:52]
  • Submitted

answer

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

#include<atcoder/maxflow>
using namespace atcoder;

bool deb=1;
void solve(){
    ll N,M;
    cin>>N>>M;
    vector<vector<ll>> A(M,vector<ll>(N));
    vector<ll> X(M,0);
    vector<unordered_set<ll>> S(M);
    for(int i=0;i<M;i++){
        for(int j=0;j<N;j++){
            cin>>A[i][j]; 
            X[i]+=A[i][j];
            S[i].insert(A[i][j]);
        }
    }
    if(X[0]==X[1]){
        for(int i=0;i<N;i++)cout<<i+1<<" \n"[i==N-1];
        if(deb)cout<<"output end"<<endl;
        return;
    }
    vector<ll> DX(M);
    for(int i=0;i<M;i++){
        DX[i]=X[i]-X[0];
    }


    mf_graph<int> G(N*2+2);
    int START=N*2;
    int GOAL=N*2+1;

    for(int i=0;i<N;i++){
        G.add_edge(START,i,1);
        G.add_edge(i+N,GOAL,1);
        for(int j=0;j<N;j++){
            bool OK=1;
            ll dx=A[1][j]-A[0][i];
            if(dx<0)continue;
            for(int m=2;m<M;m++){
                if(DX[m]*dx%DX[1]!=0){
                    OK=0;
                    break;
                }
                ll xm=DX[m]*dx/DX[1]+A[0][i];
                if(!S[m].count(xm)){
                    OK=0;
                    break;
                }
            }
            if(OK){
                //matching
                G.add_edge(i,j+N,1);
                if(deb)cout<<i<<" "<<j<<endl;

            }
        }
    }
    if(deb)cout<<"caseend"<<endl;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int T;
    cin>>T;
    while(T--)solve();
  
}

Details

answer.code:5:9: fatal error: atcoder/maxflow: No such file or directory
    5 | #include<atcoder/maxflow>
      |         ^~~~~~~~~~~~~~~~~
compilation terminated.