Submission #1048397

#TimeUsernameProblemLanguageResultExecution timeMemory
1048397nisanduuVision Program (IOI19_vision)C++14
Compilation error
0 ms0 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; bool c(int i,int j,int n,int m){ if(i<0||j<0||i>=n||j>=m) return false; return true; } void construct_network(int H, int W, int K) { vector<int> indexes; for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ int cr = i*H + j; for(int r=0;r<=k;r++){ int rem = k-r; if(c(i+r,j+rem,n,m)){ int nin = (i+r)*H + (j+rem); int in = add_and({nin,cr}); indexes.push_back(in); } if(c(i-r,j+rem,n,m)){ int nin = (i-r)*H + (j+rem); int in = add_and({nin,cr}); indexes.push_back(in); } if(c(i+r,j-rem,n,m)){ int nin = (i+r)*H + (j-rem); int in = add_and({nin,cr}); indexes.push_back(in); } if(c(i-r,j-rem,n,m)){ int nin = (i-r)*H + (j-rem); int in = add_and({nin,cr}); indexes.push_back(in); } } } } int f = add_or(indexes); }

Compilation message (stderr)

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:17:25: error: 'k' was not declared in this scope
   17 |          for(int r=0;r<=k;r++){
      |                         ^
vision.cpp:19:29: error: 'n' was not declared in this scope
   19 |              if(c(i+r,j+rem,n,m)){
      |                             ^
vision.cpp:19:31: error: 'm' was not declared in this scope
   19 |              if(c(i+r,j+rem,n,m)){
      |                               ^
vision.cpp:24:29: error: 'n' was not declared in this scope
   24 |              if(c(i-r,j+rem,n,m)){
      |                             ^
vision.cpp:24:31: error: 'm' was not declared in this scope
   24 |              if(c(i-r,j+rem,n,m)){
      |                               ^
vision.cpp:29:29: error: 'n' was not declared in this scope
   29 |              if(c(i+r,j-rem,n,m)){
      |                             ^
vision.cpp:29:31: error: 'm' was not declared in this scope
   29 |              if(c(i+r,j-rem,n,m)){
      |                               ^
vision.cpp:34:29: error: 'n' was not declared in this scope
   34 |              if(c(i-r,j-rem,n,m)){
      |                             ^
vision.cpp:34:31: error: 'm' was not declared in this scope
   34 |              if(c(i-r,j-rem,n,m)){
      |                               ^
vision.cpp:43:6: warning: unused variable 'f' [-Wunused-variable]
   43 |  int f = add_or(indexes);
      |      ^