Submission #336152

# Submission time Handle Problem Language Result Execution time Memory
336152 2020-12-14T22:39:19 Z aryan12 Vision Program (IOI19_vision) C++17
Compilation error
0 ms 0 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
int a[N];

void MakeItGood(int h, int w) {
    for(int i = 0; i < h * w - 1; i++) {
        a[i] = 0;
    }
}

int add_and(vector<int> x) {
    for(int i = 0; i < x.size(); i++) {
        if(a[x[i]] != 1)
            return 0;
    }
    return 1;
}

void construct_network(int H, int W, int K) {
    //doing for 12 points
    int curPos = H * W;
    if(H > W)
        swap(H, W);
    /*for(int i = 0; i < H * W; i++) {
        cout << a[i];
    }
    cout << endl;*/
    if(H == 1) {
        vector<int> lol(2);
        lol[0] = 0;
        lol[1] = K;
        int z = 0;
        while(lol[1] < W) {
            z = add_and(lol);
            if(z == 1)
                break;
            lol[0]++;
            lol[1]++;
        }
        //cout << z << endl;
        return;
    }
	/*std::vector<int> Ns;
	Ns = {0, 1};
	int a = add_and(Ns);
	Ns = {0, a};
	int b = add_or(Ns);
	Ns = {0, 1, b};
	int c = add_xor(Ns);
	add_not(c);*/
}
/*
int main() {
    int h, w, k;
    cin >> h >> w >> k;
    while(true) {
        int r1;
        cin >> r1;
        if(r1 == -1)
            break;
        int c1, r2, c2;
        cin >> c1 >> r2 >> c2;
        MakeItGood(h, w);
        a[r1 * w + c1] = 1;
        a[r2 * w + c2] = 1;
        construct_network(h, w, k);
    }
}
*/

Compilation message

vision.cpp: In function 'int add_and(std::vector<int>)':
vision.cpp:14:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |     for(int i = 0; i < x.size(); i++) {
      |                    ~~^~~~~~~~~~
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:23:9: warning: unused variable 'curPos' [-Wunused-variable]
   23 |     int curPos = H * W;
      |         ^~~~~~
/tmp/ccy69wcE.o: In function `add_and(std::vector<int, std::allocator<int> >)':
grader.cpp:(.text+0x3a0): multiple definition of `add_and(std::vector<int, std::allocator<int> >)'
/tmp/cc6tUrn8.o:vision.cpp:(.text+0x30): first defined here
collect2: error: ld returned 1 exit status