제출 #430934

#제출 시각아이디문제언어결과실행 시간메모리
430934_fractalVision Program (IOI19_vision)C++14
47 / 100
10 ms1104 KiB
#include "vision.h" #include <iostream> using namespace std; const int dx[] = {+1, +1}; const int dy[] = {+1, -1}; void construct_network(int H, int W, int K) { int sz = H * W, cur = H * W - 1; vector<int> ask, ksa; if (K == 1 && H > 1 && W > 1) { for (int i = 0; i < H; ++i) { ask.clear(); for (int j = 0; j < W; ++j) ask.push_back(i * W + j); add_or(ask); } for (int j = 0; j < W; ++j) { ask.clear(); for (int i = 0; i < H; ++i) ask.push_back(i * W + j); add_or(ask); } for (int i = 0; i < H - 1; ++i) { add_and({sz + i, sz + i + 1}); } sz += H; for (int i = 0; i < W - 1; ++i) { add_and({sz + i, sz + i + 1}); } ask.clear(); for (int i = 0; i < H; ++i) ask.push_back(H * W + i); for (int i = 0; i < W; ++i) ask.push_back(H * W + H + i); add_xor(ask); //H * W + H + W + H - 1 + W - 1 ask.clear(); for (int i = 0; i < H - 1; ++i) ask.push_back(H * W + H + W + i); add_or(ask); //H * W + H + W + H - 1 + W; ask.clear(); for (int i = 0; i < W - 1; ++i) ask.push_back(H * W + H + W + H - 1 + i); add_or(ask); //H * W + H + W + H + W; add_xor({H * W + H + W + H + W, H * W + H + W + H + W - 1}); add_and({H * W + H + W + H + 1 + W, H * W + H + W + H + W - 1 - 1}); return; } for (int i = 0; i < H; ++i) { for (int j = 0; j < W; ++j) { for (int k = 0; k <= K; ++k) { for (int x = 0; x < 2; ++x) { if (i + dx[x] * k >= H || i + dx[x] * k < 0 || j + dy[x] * (K - k) >= W || j + dy[x] * (K - k) < 0) continue; ask.push_back(sz); sz++; int a = i * W + j; int b = (i + dx[x] * k) * W + j + dy[x] * (K - k); add_and({a, b}); } } } } add_or(ask); return; }

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

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:10:18: warning: unused variable 'cur' [-Wunused-variable]
   10 |  int sz = H * W, cur = H * W - 1;
      |                  ^~~
#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...