Submission #1048419

#TimeUsernameProblemLanguageResultExecution timeMemory
1048419nisanduuVision 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; set<pair<int,int>> s; int n = H, m = W, k = K; for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ int cr = i*W + j; for(int r=0;r<=k;r++){ int rem = k-r; if(c(i+r,j+rem,n,m)){ int nin = (i+r)*W + (j+rem); //int in = add_and({nin,cr}); s.insert({nin,cr}); } if(c(i-r,j+rem,n,m)){ int nin = (i-r)*W + (j+rem); //int in = add_and({nin,cr}); s.insert({nin,cr}); } if(c(i+r,j-rem,n,m)){ int nin = (i+r)*W + (j-rem); //int in = add_and({nin,cr}); s.insert({nin,cr}); } if(c(i-r,j-rem,n,m)){ int nin = (i-r)*W + (j-rem); //int in = add_and({nin,cr}); s.insert({nin,cr}); } } } } for(auto z:s){ int i = add_and({z.first,z.second}); indexes.push_back(in); } int f = add_or(indexes); }

Compilation message (stderr)

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:47:24: error: 'in' was not declared in this scope; did you mean 'i'?
   47 |      indexes.push_back(in);
      |                        ^~
      |                        i
vision.cpp:46:10: warning: unused variable 'i' [-Wunused-variable]
   46 |      int i = add_and({z.first,z.second});
      |          ^
vision.cpp:49:6: warning: unused variable 'f' [-Wunused-variable]
   49 |  int f = add_or(indexes);
      |      ^