Submission #291710

# Submission time Handle Problem Language Result Execution time Memory
291710 2020-09-05T17:14:27 Z medmdg Vision Program (IOI19_vision) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include "vision.h"
using namespace std;
vector<int> DT(int H,int W,int i,int K){
    vector<int> ans;
    for(int j=i+K;j<H*W-K;j++){
        if(abs(j%W-i%W)+abs(j/W-i/W)==K){
            ans.push_back(j);
        }
    }
    return ans;
}
void construct_network(int H, int W, int K){
    vector<int> b;
    b.push_back(0);
    b.push_back(1);
    if(H*W>2)
        b.push_back(2);
    int l=add_and(b);
    b.pop_back();
    b.pop_back();
    if(b.size())
        b.pop_back();
    b.push_back(l);
    if(H*W==2){
        if(K==1)
            return;
        else
            l=add_not(0);
        return;
    }
    if(min(H,W)==1){
        for(int i=0;i<H*W-K;i++){
            vector<int> ans;
            ans.push_back(i);
            ans.push_back(i+K);
            l=add_and(ans);
            ans.pop_back();
            ans.pop_back();
            ans.push_back(l-1);
            ans.push_back(l);
            l=add_or(ans);
        }
        return;
    }
    if(max(H,W)<=100){
        for(int i=0;i<H*W-K;i+=2){
            vector<int> ans;
            ans=DT(i);
        }
    }
    else{
        vector<int> ans;
        for(int i=1;i<H*W;i++){
            if((i%W)+(i/W)==K){
                ans.push_back(i);
            }
        }
        l=add_or(ans);
        return;
    }
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:49:21: error: too few arguments to function 'std::vector<int> DT(int, int, int, int)'
   49 |             ans=DT(i);
      |                     ^
vision.cpp:4:13: note: declared here
    4 | vector<int> DT(int H,int W,int i,int K){
      |             ^~