Submission #602454

#TimeUsernameProblemLanguageResultExecution timeMemory
602454JohannVision Program (IOI19_vision)C++14
44 / 100
9 ms1868 KiB
#include "vision.h" using namespace std; typedef vector<int> vi; #define sz(x) (int)(x).size() int h, w, k; int calc_pos(int x, int y) { return y * w + x; } void construct_network(int H, int W, int K) { h = H; w = W; k = K; vi all(0); for (int x = 0; x < W; ++x) { for (int y = 0; y < H; ++y) { vi neigs; for (int dx = -K; dx < K; ++dx) { int nx = x + dx, ny = y + min(abs(dx - K), abs(dx + K)); if (0 <= nx && nx < W && 0 <= ny && ny < H) neigs.push_back(calc_pos(nx, ny)); } if (sz(neigs) > 0) all.push_back(add_and({calc_pos(x, y), add_or(neigs)})); } } if (sz(all) == 0) { for (int x = 0; x < W; ++x) { for (int y = 0; y < H; ++y) { all.push_back(calc_pos(x, y)); } } add_not(add_or(all)); } else { add_or(all); }; }
#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...