Submission #308952

#TimeUsernameProblemLanguageResultExecution timeMemory
308952amunduzbaevUnscrambling a Messy Bug (IOI16_messy)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

#include "messy.h"
#include "grader.cpp"

vector<string>v;
int n1;

void add(){
    string s(n1,'0');
    s[0]='0';
    for(int i=1;i<n1;i++) s[i]='1';
    int last=1;
    for(int i=0;i<n1-1;i++){
        add_element(s);
        s[last]='0';
        last++;
    }
    //cout<<"worked\n";
}
void check(){
    string s(n1,'0');
    for(int i=0;i<n-1;i++){
        for(int j=0;j<n;j++){
            if(s[j]=='0'){
                s[j]='1';
                if(check_element(s)) {
                    v.push_back(s);
                    break;
                }
                else s[j]='0';
            }
        }
    }
}
vector<int> restore_permutation(int N, int w, int r) {
    n1=N;
    add();
    compile_set();
    check();
    int vs=v.size();
    vector<int>ans(n1,0),a(n1,0);
    for(int i=0;i<vs;i++){
        for(int j=0;j<n1;j++){
            a[j]+=(v[i][j]-'0');
        }
    }
    //for(int i=0;i<n1;i++){
    //    ans[a[i]]=i;
    //}
    //for(int i=0;i<n1;i++)
    //    cout<<a[i]<<" ";
    return a;
}
/*

4
16 16
1 3 2 0

*/

Compilation message (stderr)

/tmp/cceMkYx5.o: In function `helper::read_int()':
grader.cpp:(.text+0x0): multiple definition of `helper::read_int()'
/tmp/ccAsFkKP.o:messy.cpp:(.text+0x0): first defined here
/tmp/cceMkYx5.o: In function `get_p(int)':
grader.cpp:(.text+0x50): multiple definition of `get_p(int)'
/tmp/ccAsFkKP.o:messy.cpp:(.text+0x50): first defined here
/tmp/cceMkYx5.o:(.bss+0x10): multiple definition of `helper::p'
/tmp/ccAsFkKP.o:(.bss+0x30): first defined here
/tmp/cceMkYx5.o: In function `wa()':
grader.cpp:(.text+0x70): multiple definition of `wa()'
/tmp/ccAsFkKP.o:messy.cpp:(.text+0x70): first defined here
/tmp/cceMkYx5.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccAsFkKP.o:messy.cpp:(.text.startup+0x0): first defined here
/tmp/cceMkYx5.o:(.bss+0x28): multiple definition of `helper::n'
/tmp/ccAsFkKP.o:(.bss+0x48): first defined here
/tmp/cceMkYx5.o:(.bss+0x4): multiple definition of `helper::w'
/tmp/ccAsFkKP.o:(.bss+0x2c): first defined here
/tmp/cceMkYx5.o:(.bss+0x0): multiple definition of `helper::r'
/tmp/ccAsFkKP.o:(.bss+0x28): first defined here
/tmp/cceMkYx5.o:(.bss+0x2c): multiple definition of `helper::compiled'
/tmp/ccAsFkKP.o:(.bss+0x4c): first defined here
/tmp/cceMkYx5.o: In function `check(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
grader.cpp:(.text+0xa0): multiple definition of `check(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/ccAsFkKP.o:messy.cpp:(.text+0xa0): first defined here
/tmp/cceMkYx5.o: In function `check_element(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
grader.cpp:(.text+0xf0): multiple definition of `check_element(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/tmp/ccAsFkKP.o:messy.cpp:(.text+0xf0): first defined here
/tmp/cceMkYx5.o:(.bss+0x40): multiple definition of `helper::set_[abi:cxx11]'
/tmp/ccAsFkKP.o:(.bss+0x60): first defined here
/tmp/cceMkYx5.o: In function `add_element(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
grader.cpp:(.text+0x250): multiple definition of `add_element(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/tmp/ccAsFkKP.o:messy.cpp:(.text+0x3f0): first defined here
/tmp/cceMkYx5.o: In function `compile_set()':
grader.cpp:(.text+0x2b0): multiple definition of `compile_set()'
/tmp/ccAsFkKP.o:messy.cpp:(.text+0x560): first defined here
collect2: error: ld returned 1 exit status