Submission #410298

#TimeUsernameProblemLanguageResultExecution timeMemory
410298Tc14Vision Program (IOI19_vision)C++17
0 / 100
42 ms10416 KiB
//#pragma GCC optimize("O3") #include <bits/stdc++.h> #include "vision.h" using namespace std; #define ve vector typedef long long ll; typedef pair<int, int> pii; const int INF = 1e9 + 10; void construct_network(int H, int W, int K) { ve<int> X; set<pii> S; for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { int index = i * W + j; for (int k = -K; k <= K; k++) { int iNew = i + k; int jNew = j + (K - abs(k)); int indexNew = iNew * W + jNew; if (0 <= iNew && iNew < H && 0 <= jNew && jNew < W) { if (index > indexNew) swap(index, indexNew); S.insert({index, indexNew}); } iNew = i + k; jNew = j - (K - abs(k)); indexNew = iNew * W + jNew; if (0 <= iNew && iNew < H && 0 <= jNew && jNew < W) { if (index > indexNew) swap(index, indexNew); S.insert({index, indexNew}); } } } } for (pii s : S) { int x = add_and({s.first, s.second}); X.push_back(x); } add_or(X); }
#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...