QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#314213#63. MeetingsXttttrCompile Error//C++14913b2024-01-25 14:26:342024-01-25 14:26:36

Judging History

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

  • [2024-01-25 14:26:36]
  • 评测
  • [2024-01-25 14:26:34]
  • 提交

answer

#include<bits/stdc++.h>
#include "meetings.h"
using namespace std;
mt19937 nsc(time(0));
void Bridge(int x,int y){
    return;
}
inline void add_edge(int x,int y){
    if(x>y)swap(x,y);
    Bridge(x,y);
}
inline void solve(vector<int>q){
    int n=q.size();
    if(n==1)return;
    if(n==2)return add_edge(q[0],q[1]),void();
    shuffle(q.begin(),q.end(),nsc);
    vector<pair<int,int> >a(n);
    a[0]=make_pair(q[0],0),a[1]=make_pair(q[1],1);
    for(int i=2;i<n;i++)a[i]=make_pair(Query(q[0],q[1],q[i]),i);
    sort(a.begin(),a.end());
    vector<int>qq;
    for(int l=0,r=0;l<n;l=++r){
        qq.push_back(a[l].first);
        vector<int>cur(1,a[l].second);
        while(r+1<n&&a[r+1].first==a[r].first)cur.push_back(a[++r].second);
        solve(cur);
    }
    solve(qq);
}
inline void Solve(int N){
    vector<int>q;
    for(int i=0;i<N;i++)q.push_back(i);
    solve(q);
}

Details

/usr/bin/ld: /tmp/ccFzorC4.o: in function `Bridge(int, int)':
answer.code:(.text+0x0): multiple definition of `Bridge(int, int)'; /tmp/cc3TZH11.o:implementer.cpp:(.text+0x270): first defined here
/usr/bin/ld: /tmp/cc3TZH11.o: in function `main':
implementer.cpp:(.text.startup+0x143): undefined reference to `Solve(int)'
collect2: error: ld returned 1 exit status