제출 #1048410

#제출 시각아이디문제언어결과실행 시간메모리
1048410TahirAliyevVision Program (IOI19_vision)C++17
컴파일 에러
0 ms0 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; void construct_network(int H, int W, int K) { for(int i = 0; i < H; i++){ for(int j = 0; j < W; j++){ if(add_not(i * W + j)) continue; vector<int> v; for(int k = 0; k < H; k++){ int x = i + k, y = j + K - k; if(x < 0 || x >= H || y < 0 || y >= W) continue; v.push_back(x * W + y); int x = i + k, y = j - (K - k); if(x < 0 || x >= H || y < 0 || y >= W) continue; v.push_back(x * W + y); } if(add_or(v)) return; } } }

컴파일 시 표준 에러 (stderr) 메시지

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:14:9: error: redeclaration of 'int x'
   14 |     int x = i + k, y = j - (K - k);
      |         ^
vision.cpp:11:9: note: 'int x' previously declared here
   11 |     int x = i + k, y = j + K - k;
      |         ^
vision.cpp:14:20: error: redeclaration of 'int y'
   14 |     int x = i + k, y = j - (K - k);
      |                    ^
vision.cpp:11:20: note: 'int y' previously declared here
   11 |     int x = i + k, y = j + K - k;
      |                    ^