Submission #226401

# Submission time Handle Problem Language Result Execution time Memory
226401 2020-04-23T17:54:12 Z AaronNaidu Vision Program (IOI19_vision) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;


void construct_network(int h, int w, int k) {
    int totSum = 0;
    for (int i = 0; i < h; i++)
    {
        for (int j = 0; j < w; j++)
        {
            for (int x = i; x < h; x++)
            {
                for (int y = 0; y < w; y++)
                {
                    if (abs(i-x) + abs(j-y) == k)
                    {
                        totSum++;
                        add_and({i*w + j, x*w + y});
                    }
                    
                }
                
            }
            
        }
        
    }
    vector<int> last;
    for (int i = 0; i < totSum; i++)
    {
        last.push_back(i + h * w);
    }
    add_or(last); 
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:18:25: error: 'add_and' was not declared in this scope
                         add_and({i*w + j, x*w + y});
                         ^~~~~~~
vision.cpp:33:5: error: 'add_or' was not declared in this scope
     add_or(last); 
     ^~~~~~
vision.cpp:33:5: note: suggested alternative: 'rand_r'
     add_or(last); 
     ^~~~~~
     rand_r