Submission #601178

#TimeUsernameProblemLanguageResultExecution timeMemory
601178SeDunionVision Program (IOI19_vision)C++17
100 / 100
25 ms3284 KiB
#include "vision.h" #include<algorithm> #include<iostream> #include<vector> #include<cmath> using namespace std; void construct_network(int H, int W, int K) { vector<vector<int>>D1(H+W-1), D2(H+W-1); for (int i = 0 ; i < H ; ++ i) { for (int j = 0 ; j < W ; ++ j) { D1[i + j].emplace_back(i * W + j); D2[i + W - 1 - j].emplace_back(i * W + j); } } vector<int>X(H+W-1), Y(H+W-1); for (int i = 0 ; i < H+W-1 ; ++ i) X[i] = add_or(D1[i]); for (int i = 0 ; i < H+W-1 ; ++ i) Y[i] = add_or(D2[i]); vector<int>res; for (int _ = 0 ; _ < 2 ; ++ _) { vector<int>F, S={add_xor(Y)}; for (int i = K ; i < H+W-1 ; ++ i) F.emplace_back(add_and({X[i-K], X[i]})); for (int i = 1 ; i < H+W-1 ; ++ i) { vector<int>temp; for (int j = max(0, i-K) ; j < i ; ++ j) temp.emplace_back(Y[j]); S.emplace_back(add_and({Y[i], add_or(temp)})); } res.emplace_back(add_and({add_or(F), add_or(S)})); swap(X, Y); } add_or(res); }
#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...