Submission #416321

#TimeUsernameProblemLanguageResultExecution timeMemory
416321xyzVision Program (IOI19_vision)C++17
100 / 100
87 ms5868 KiB
#include <bits/stdc++.h> #include "vision.h" using namespace std; typedef long long ll; int solve(int H, int W, int K){ vector<int> X[405], Y[405]; for(int i = 0; i < H; i ++){ for(int j = 0; j < W; j ++){ X[i + j].push_back(i * W + j); Y[i + W - 1 - j].push_back(i * W + j); } } vector<int> allX, allY, prefX, prefY, result; for(int i = 0; i <= H + W - 2; i ++){ allX.push_back(add_or(X[i])); allY.push_back(add_or(Y[i])); prefX.push_back(add_or(allX)); prefY.push_back(add_or(allY)); if(i >= K){ result.push_back(add_and({allX[i], prefX[i - K]})); result.push_back(add_and({allY[i], prefY[i - K]})); } } return add_or(result); } void construct_network(int H, int W, int K) { if(H + W - 2 == K) solve(H, W, K); else add_xor({solve(H, W, K), solve(H, W, K + 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...