Submission #99311

# Submission time Handle Problem Language Result Execution time Memory
99311 2019-03-02T10:24:40 Z Mercenary ICC (CEOI16_icc) C++14
Compilation error
0 ms 0 KB
#ifndef __GRADER_CPP__
#define __GRADER_CPP__

#include "graderlib.cpp"
#include "icc.h"
#include <bits/stdc++.h>
const int maxn = 105;
using namespace std;

vector<int> P[maxn];

int papa[maxn];

int Cal(vector<int> a , vector<int> b)
{
    assert(a.size() > 0);
    int n = a.size();
    if(n == 1)return a[0];
    vector<int> tmp;
    int mid = n / 2;
    for(int i = 0 ; i < mid ; ++i)tmp.push_back(a[i]);
    if(query(tmp.size(),b.size(),tmp.data(),b.data()))return Cal(tmp,b);
    tmp.clear();
    for(int i = mid ; i < n ; ++i)tmp.push_back(a[i]);
    return Cal(tmp,b);
}

void run(int n)
{
    for(int i = 1 ; i <= n ; ++i)P[i].push_back(i) , papa[i] = i;
    for(int i = n ; i > 1 ; --i)
    {
        sort(P + 1 , P + i + 1);
        for(int j = 1 ; j <= i ; ++j)
            for(int c : P[j])papa[c] = j;
        vector<int> a , b;
        for(int j = 0 ; j < 8 ; ++j)
        {
            a.clear();b.clear();
            for(int k = 1 ; k <= i ; ++k)
            {
                if((k >> j) & 1)for(int c : P[k])a.push_back(c);
                else for(int c : P[k])b.push_back(c);
            }
            if(a.size() == 0 || b.size() == 0)continue;
            if(query(a.size(),b.size(),a.data(),b.data()))break;
        }
        assert(a.size() > 0 && b.size() > 0);
        int u  = Cal(a , b);
        int v = Cal(b , a);
        setRoad(u,v);
//        cout << u << " " << v << endl;
        u = papa[u];
        v = papa[v];
//        cout << u << " " << v << endl;
        if(u > v)swap(u,v);
        for(int c : P[v])papa[c] = u , P[u].push_back(c);
        if(i != v){
            for(int c : P[i])papa[c] = v;
            swap(P[v],P[i]);
        }
        P[i].clear();
    }
}

int main() {
    using namespace ceoi_2016;
    InitGrader();

    run(NumVertices());

    GraderExitFail();
    printf("SUCCESS");
    return 0;
}

#endif // __GRADER_CPP__

Compilation message

/tmp/ccBDKXl9.o: In function `ceoi_2016::BasicSolver::SetEdge(int, int)':
grader.cpp:(.text+0x0): multiple definition of `ceoi_2016::BasicSolver::SetEdge(int, int)'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x0): first defined here
/tmp/ccBDKXl9.o: In function `ceoi_2016::BasicInteractiveSolver::MaxScoreFromAMInfo(ceoi_2016::AdjacencyMatrixInformation)':
grader.cpp:(.text+0x60): multiple definition of `ceoi_2016::BasicInteractiveSolver::MaxScoreFromAMInfo(ceoi_2016::AdjacencyMatrixInformation)'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x90): first defined here
/tmp/ccBDKXl9.o: In function `ceoi_2016::GetAMInformation(std::array<std::array<int, 101ul>, 101ul> const&, std::vector<int, std::allocator<int> > const&)':
grader.cpp:(.text+0x260): multiple definition of `ceoi_2016::GetAMInformation(std::array<std::array<int, 101ul>, 101ul> const&, std::vector<int, std::allocator<int> > const&)'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x3c0): first defined here
/tmp/ccBDKXl9.o: In function `ceoi_2016::BasicInteractiveSolver::ResetValidEdges()':
grader.cpp:(.text+0x3b0): multiple definition of `ceoi_2016::BasicInteractiveSolver::ResetValidEdges()'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x510): first defined here
/tmp/ccBDKXl9.o: In function `ceoi_2016::BasicInteractiveSolver::GetIncludedExcluded(int, int, int*, int*)':
grader.cpp:(.text+0x410): multiple definition of `ceoi_2016::BasicInteractiveSolver::GetIncludedExcluded(int, int, int*, int*)'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x570): first defined here
/tmp/ccBDKXl9.o: In function `ceoi_2016::Interaction::Fail(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
grader.cpp:(.text+0x620): multiple definition of `ceoi_2016::Interaction::Fail(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x780): first defined here
/tmp/ccBDKXl9.o: In function `ceoi_2016::Interaction::SetScore(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
grader.cpp:(.text+0x670): multiple definition of `ceoi_2016::Interaction::SetScore(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x7d0): first defined here
/tmp/ccBDKXl9.o: In function `ceoi_2016::Fail(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
grader.cpp:(.text+0x630): multiple definition of `ceoi_2016::Fail(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x790): first defined here
/tmp/ccBDKXl9.o:(.bss+0x0): multiple definition of `ceoi_2016::interaction'
/tmp/ccu54ptr.o:(.bss+0xb98): first defined here
/tmp/ccBDKXl9.o: In function `ceoi_2016::Expect(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
grader.cpp:(.text+0x650): multiple definition of `ceoi_2016::Expect(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x7b0): first defined here
/tmp/ccBDKXl9.o: In function `ceoi_2016::BasicSolver::Query(int, int, int*, int*)':
grader.cpp:(.text+0x750): multiple definition of `ceoi_2016::BasicSolver::Query(int, int, int*, int*)'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x8b0): first defined here
/tmp/ccBDKXl9.o: In function `ceoi_2016::BasicInteractiveSolver::IsAlreadyGood(int, int, int*, int*)':
grader.cpp:(.text+0xa80): multiple definition of `ceoi_2016::BasicInteractiveSolver::IsAlreadyGood(int, int, int*, int*)'
/tmp/ccu54ptr.o:icc.cpp:(.text+0xbe0): first defined here
/tmp/ccBDKXl9.o: In function `ceoi_2016::BasicInteractiveSolver::Query(int, int, int*, int*)':
grader.cpp:(.text+0xdb0): multiple definition of `ceoi_2016::BasicInteractiveSolver::Query(int, int, int*, int*)'
/tmp/ccu54ptr.o:icc.cpp:(.text+0xf10): first defined here
/tmp/ccBDKXl9.o: In function `InitGrader':
grader.cpp:(.text+0xf90): multiple definition of `InitGrader'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x10f0): first defined here
/tmp/ccBDKXl9.o: In function `GraderExitFail':
grader.cpp:(.text+0x1580): multiple definition of `GraderExitFail'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x16e0): first defined here
/tmp/ccBDKXl9.o: In function `NumVertices':
grader.cpp:(.text+0x15d0): multiple definition of `NumVertices'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x1730): first defined here
/tmp/ccBDKXl9.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccu54ptr.o:icc.cpp:(.text.startup+0x0): first defined here
/tmp/ccBDKXl9.o: In function `ceoi_2016::Interaction::Query(int, int, int*, int*)':
grader.cpp:(.text+0x15f0): multiple definition of `ceoi_2016::Interaction::Query(int, int, int*, int*)'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x1750): first defined here
/tmp/ccBDKXl9.o: In function `query':
grader.cpp:(.text+0x1980): multiple definition of `query'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x1ae0): first defined here
/tmp/ccBDKXl9.o: In function `ceoi_2016::Interaction::DecideScore()':
grader.cpp:(.text+0x19b0): multiple definition of `ceoi_2016::Interaction::DecideScore()'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x1b10): first defined here
/tmp/ccBDKXl9.o: In function `ceoi_2016::Interaction::SetEdge(int, int)':
grader.cpp:(.text+0x1c50): multiple definition of `ceoi_2016::Interaction::SetEdge(int, int)'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x1db0): first defined here
/tmp/ccBDKXl9.o: In function `setRoad':
grader.cpp:(.text+0x1d10): multiple definition of `setRoad'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x1e70): first defined here
/tmp/ccBDKXl9.o: In function `ceoi_2016::BasicInteractiveSolver::UniteVertices(int, int)':
grader.cpp:(.text+0x1d20): multiple definition of `ceoi_2016::BasicInteractiveSolver::UniteVertices(int, int)'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x2350): first defined here
/tmp/ccBDKXl9.o: In function `ceoi_2016::BasicInteractiveSolver::SetEdge(int, int)':
grader.cpp:(.text+0x1dc0): multiple definition of `ceoi_2016::BasicInteractiveSolver::SetEdge(int, int)'
/tmp/ccu54ptr.o:icc.cpp:(.text+0x23f0): first defined here
collect2: error: ld returned 1 exit status