Submission #667873

# Submission time Handle Problem Language Result Execution time Memory
667873 2022-12-02T07:36:35 Z coding_snorlax Vision Program (IOI19_vision) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
//#include "vision.h"
using namespace std;
int List1[200006]={0};
int row,column;
int num (int i,int j){
    return i*column+j;
}
int dis (int i,int j,int k,int l){
    return abs(i-k)+abs(j-l);
}
void add_xor(vector<int> b){
    cout<<"---xor---\n";
    for(int a=0;a<(int)b.size();a++){
        cout<<b[a]<<" ";
    }
    cout<<"\n";
}
void add_and(vector<int> b){
    cout<<"---and---\n";
    for(int a=0;a<(int)b.size();a++){
        cout<<b[a]<<" ";
    }
    cout<<"\n";
}
void add_or(vector<int> b){
    cout<<"---or---\n";
    for(int a=0;a<(int)b.size();a++){
        cout<<b[a]<<" ";
    }
    cout<<"\n";
}
void construct_network(int H,int W,int K){
    row=H;
    column=W;
    vector<int> s;
    for(int i=0;i<1;i++){
        for(int j=0;j<1;j++){
            s.clear();
            for(int k=0;k<H;k++){
                for(int l=0;l<W;l++){
                    if(dis(i,j,k,l)==K) s.push_back(num(k,l));
                }
            }
            if((int)s.size()==0){
                s.push_back(0);
                s.push_back(1);
                s.push_back(2);
                add_and(s);
            }
            else{
                add_xor(s);
            }
        }
    }
    vector<int> s1={0,H*W};
    for(int i=0;i<H*W;i++){
        add_and(s1);
        s1[0]++;
        s1[1]++;
    }
    vector<int> s2;
    for(int i=0;i<H*W;i++){
        s2.push_back(i+2*H*W);
    }
    add_or(s2);
    return;
}
int main(){
    construct_network(2,3,1);
}

Compilation message

/usr/bin/ld: /tmp/ccxrMZKU.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccEfrGrT.o:vision.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccxrMZKU.o: in function `add_and(std::vector<int, std::allocator<int> >)':
grader.cpp:(.text+0x210): multiple definition of `add_and(std::vector<int, std::allocator<int> >)'; /tmp/ccEfrGrT.o:vision.cpp:(.text+0xd0): first defined here
/usr/bin/ld: /tmp/ccxrMZKU.o: in function `add_or(std::vector<int, std::allocator<int> >)':
grader.cpp:(.text+0x230): multiple definition of `add_or(std::vector<int, std::allocator<int> >)'; /tmp/ccEfrGrT.o:vision.cpp:(.text+0x170): first defined here
/usr/bin/ld: /tmp/ccxrMZKU.o: in function `add_xor(std::vector<int, std::allocator<int> >)':
grader.cpp:(.text+0x250): multiple definition of `add_xor(std::vector<int, std::allocator<int> >)'; /tmp/ccEfrGrT.o:vision.cpp:(.text+0x30): first defined here
collect2: error: ld returned 1 exit status