Submission #667858

# Submission time Handle Problem Language Result Execution time Memory
667858 2022-12-02T07:22:53 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};
void num (int i,int j){
    return i*W+j;
}
int dis (int i,int j,int k,int l){
    return abs(i-k)+abs(j-l);
}
void construct_network(int H,int W,int K){
    row=H;
    column=W;
    int Total=max(H,W);
    vector<int> s;
    for(int i=0;i<H;i++){
        for(int j=0;j<W;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));
                }
            }
            add_xor(s);
        }
    }
    vector<int> s1={0,H*W};
    for(int i=0;i<H*W;i++){
        add_and(s);
        s[0]++;
        s[1]++;
    }
    vector<int> s2;
    for(int i=0,i<H*W){
        s1.push_back(i+2*H*W);
    }
    add_or(s1);
    return;
}

Compilation message

vision.cpp: In function 'void num(int, int)':
vision.cpp:5:14: error: 'W' was not declared in this scope
    5 |     return i*W+j;
      |              ^
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:11:5: error: 'row' was not declared in this scope; did you mean 'pow'?
   11 |     row=H;
      |     ^~~
      |     pow
vision.cpp:12:5: error: 'column' was not declared in this scope
   12 |     column=W;
      |     ^~~~~~
vision.cpp:20:56: error: invalid use of void expression
   20 |                     if(dis(i,j,k,l)==K) s.push_back(num(k,l));
      |                                                     ~~~^~~~~
vision.cpp:33:18: error: expected ';' before '<' token
   33 |     for(int i=0,i<H*W){
      |                  ^
      |                  ;
vision.cpp:33:18: error: expected primary-expression before '<' token
vision.cpp:33:22: error: expected ';' before ')' token
   33 |     for(int i=0,i<H*W){
      |                      ^
      |                      ;
vision.cpp:13:9: warning: unused variable 'Total' [-Wunused-variable]
   13 |     int Total=max(H,W);
      |         ^~~~~