Submission #316388

# Submission time Handle Problem Language Result Execution time Memory
316388 2020-10-26T08:49:04 Z kylych03 Vision Program (IOI19_vision) C++14
Compilation error
0 ms 0 KB
#include "vision.h"
#include <bits/stdc++.h>
#include "grader.cpp"
using namespace std;
void construct_network(int H, int W, int K) {
    vector<int> vec;
    if(K==1){
        for(int i  = 0 ; i < H; i++ ){
            for(int j = 0 ; j < W; j++){
                if( i + 1 < H ){
                        int p1 = i*W + j;
                        int p2 = (i+1)*W + j;
                        vector <int> v;
                        v.push_back(p1);
                        v.push_back(p2);
                        vec.push_back( add_and(v) );
                    }
                if( j + 1 < W ){
                        int p1 = i*W + j;
                        int p2 = i*W + j+1;
                        vector <int> v;
                        v.push_back(p1);
                        v.push_back(p2);
                        vec.push_back( add_and(v) );
                    }
            }
        }

    }
    else
	for(int i  = 0 ; i < H; i++ ){
        for(int j = 0 ; j < W; j++){
            vector <int> v,v1;
            for(int t = i; t< H; t++)
                for(int p = 0 ; p < W; p++)
                    if(abs (t - i) + abs(p - j) == K){
                        int p2 = t*W + p;
                        v.push_back(p2);
                    }
            int p1 = i*W + j;
            v1.push_back(p1);
            if(v.size()== 0)
                continue;
            v1.push_back( add_or(v));
            vec.push_back( add_and(v1) );
        }
	}
	add_or(vec);

	//add_not(c);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:30:5: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
   30 |     else
      |     ^~~~
vision.cpp:48:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
   48 |  add_or(vec);
      |  ^~~~~~
/tmp/ccAWwtdF.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccTMOTwU.o:vision.cpp:(.text.startup+0x0): first defined here
/tmp/ccAWwtdF.o: In function `add_not(int)':
grader.cpp:(.text+0x260): multiple definition of `add_not(int)'
/tmp/ccTMOTwU.o:vision.cpp:(.text+0x770): first defined here
/tmp/ccAWwtdF.o: In function `add_xor(std::vector<int, std::allocator<int> >)':
grader.cpp:(.text+0x430): multiple definition of `add_xor(std::vector<int, std::allocator<int> >)'
/tmp/ccTMOTwU.o:vision.cpp:(.text+0x5c0): first defined here
/tmp/ccAWwtdF.o: In function `add_and(std::vector<int, std::allocator<int> >)':
grader.cpp:(.text+0x5e0): multiple definition of `add_and(std::vector<int, std::allocator<int> >)'
/tmp/ccTMOTwU.o:vision.cpp:(.text+0x260): first defined here
/tmp/ccAWwtdF.o: In function `add_or(std::vector<int, std::allocator<int> >)':
grader.cpp:(.text+0x790): multiple definition of `add_or(std::vector<int, std::allocator<int> >)'
/tmp/ccTMOTwU.o:vision.cpp:(.text+0x410): first defined here
collect2: error: ld returned 1 exit status