제출 #336165

#제출 시각아이디문제언어결과실행 시간메모리
336165aryan12Vision Program (IOI19_vision)C++17
0 / 100
2 ms1128 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; const int N = 1e5; int a[N]; void MakeItGood(int h, int w) { for(int i = 0; i < h * w - 1; i++) { a[i] = 0; } } /*int add_and(vector<int> x) { int ans = 1; for(int i = 0; i < x.size(); i++) { ans &= a[x[i]]; } return ans; } int add_or(vector<int> x) { int ans = 0; for(int i = 0; i < x.size(); i++) { ans |= a[x[i]]; } return ans; }*/ void construct_network(int H, int W, int K) { vector<int> x; for(int i = 0; i < H; i++) { for(int j = 0; j < W; j++) { for(int y = 0; y < K; y++) { int newx = i + y, newy = j + K - y; if(i + y < H) { if(j + K - y < W) { x.push_back(add_and({i * W + j, (i + y) * W + j + K - y})); } if(j - K + y >= 0) { x.push_back(add_and({i * W + j, (i + y) * W + j - K + y})); } } if(i - y >= 0) { if(j + K - y < W) { x.push_back(add_and({i * W + j, (i - y) * W + j + K - y})); } if(j - K + y >= 0) { x.push_back(add_and({i * W + j, (i - y) * W + j - K + y})); } } } } } add_or(x); /*std::vector<int> Ns; Ns = {0, 1}; int a = add_and(Ns); Ns = {0, a}; int b = add_or(Ns); Ns = {0, 1, b}; int c = add_xor(Ns); add_not(c);*/ } /*int main() { int h, w, k; cin >> h >> w >> k; while(true) { int r1; cin >> r1; if(r1 == -1) break; int c1, r2, c2; cin >> c1 >> r2 >> c2; MakeItGood(h, w); a[r1 * w + c1] = 1; a[r2 * w + c2] = 1; construct_network(h, w, k); } }*/

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

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:34:21: warning: unused variable 'newx' [-Wunused-variable]
   34 |                 int newx = i + y, newy = j + K - y;
      |                     ^~~~
vision.cpp:34:35: warning: unused variable 'newy' [-Wunused-variable]
   34 |                 int newx = i + y, newy = j + K - y;
      |                                   ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...