Submission #1064909

#TimeUsernameProblemLanguageResultExecution timeMemory
1064909Ahmed57Vision Program (IOI19_vision)C++17
Compilation error
0 ms0 KiB
#include "bits/stdc++.h" using namespace std; #include "vision.h" void construct_network(int H, int W, int K){ for(int i = 0;i<H;i++){ vector<int> v; for(int j = 0;j<W;j++){ v.push_back(i*W+j); } int val = add_xor(v); } for(int j = 0;j<W;j++){ vector<int> v; for(int i = 0;i<H;i++){ v.push_back(i*W+j); } int val = add_xor(v); } int init = H*W; for(int i = 0;i<H;i++){ vector<int> v; v.push_back(init+i); if(i)v.push_back(init+H+W+i-1); int val = add_xor(v); } init = H*W+H; for(int i = 0;i<W;i++){ vector<int> v; v.push_back(init+i); if(i)v.push_back(init+H+W+i-1); int val = add_xor(v); } init = H*W+H+W; int val = add_not(init); vector<int> bits; for(int i = 0;i<15;i++){ bits.push_back(add_and({val,init})); } for(int i = 0;i<H+W;i++){ vector<int> nbits; vector<int> lol = {init+i}; for(int i = 0;i<15;i++){ int val = add_and(lol); nbits.push_back(add_xor({val,bits[i]})); lol.push_back(bits[i]); } bits=nbits; } vector<int> nbits; for(int i = 0;i<15;i++){ if(K&(1<<i)){ nbits.push_back(bits[i]); }else nbits.push_back(add_not(bits[i])); } int val = add_and(nbits); }

Compilation message (stderr)

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:11:13: warning: unused variable 'val' [-Wunused-variable]
   11 |         int val = add_xor(v);
      |             ^~~
vision.cpp:18:13: warning: unused variable 'val' [-Wunused-variable]
   18 |         int val = add_xor(v);
      |             ^~~
vision.cpp:25:13: warning: unused variable 'val' [-Wunused-variable]
   25 |         int val = add_xor(v);
      |             ^~~
vision.cpp:32:13: warning: unused variable 'val' [-Wunused-variable]
   32 |         int val = add_xor(v);
      |             ^~~
vision.cpp:56:9: error: redeclaration of 'int val'
   56 |     int val = add_and(nbits);
      |         ^~~
vision.cpp:35:9: note: 'int val' previously declared here
   35 |     int val = add_not(init);
      |         ^~~