답안 #441733

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
441733 2021-07-06T00:33:49 Z julian33 슈퍼트리 잇기 (IOI20_supertrees) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#define deb(...) logger(#__VA_ARGS__, __VA_ARGS__)
template<typename ...Args>
void logger(string vars, Args&&... values) {
    cerr<<vars<<" = ";
    string delim="";
    (...,(cerr<<delim<<values,delim=", "));
    cerr<<"\n";
}
#else
#define deb(...) logger(#__VA_ARGS__, __VA_ARGS__)
template<typename ...Args>
void logger(string vars, Args&&... values) {}
#endif

#define FOR(i,j,n) for(int i=j;i<n;i++)

#define pb push_back
#define sz(x) (int)(x.size())
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<typename T> inline void maxa(T& a,T b){a=max(a,b);}
template<typename T> inline void mina(T& a,T b){a=min(a,b);} 

/*
subtask 1: make a line graph
subtask 2: make multiple line graphs, make sure no components have contradictions
subtask 3: make multiple rings, make sure no contradictions
subtask 4: in each component, make components of 2s. Form these into rings. connect the rings. 
then get components of ones and make them into line graphs.
subtask 5: subtask 4 and check for contradictions
subtask 6: for the components of 3, make a ring and add an extra edge

rings must have at least 3 nodes
3-rings must have at least 4 nodes
*/

void build(vector<vector<int>> b){

}

int construct(vector<vector<int>> p){
    int n=sz(p);
    vector<vector<int>> b;
    b.reserve(n);
    for(auto &u:b)
        u.reserve(n);
    for(int i=0;i<n-1;i++){
        b[i][i+1]=b[i+1][i]=1;
    }
    build(b);
    return 1;
}

Compilation message

/usr/bin/ld: /tmp/ccAvLc3p.o: in function `build(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >)':
grader.cpp:(.text+0x320): multiple definition of `build(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >)'; /tmp/ccwqlR3t.o:supertrees.cpp:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status