Submission #144392

#TimeUsernameProblemLanguageResultExecution timeMemory
144392qkxwsmVision Program (IOI19_vision)C++14
0 / 100
11 ms1220 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; template<class T, class U> void ckmin(T &a, U b) { if (a > b) a = b; } template<class T, class U> void ckmax(T &a, U b) { if (a < b) a = b; } #define MP make_pair #define PB push_back #define LB lower_bound #define UB upper_bound #define fi first #define se second #define FOR(i, a, b) for (auto i = (a); i < (b); i++) #define FORD(i, a, b) for (auto i = (a) - 1; i >= (b); i--) #define SZ(x) ((int) (x).size()) #define ALL(x) (x).begin(), (x).end() typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<pii> vpi; typedef vector<pll> vpl; int N, M, K, C, S[10]; vi tmp; void construct_network(int n, int m, int k) { //you want to see if the two squares with 1 are at distance K N = n; M = m; K = k; C = N * M; S[0] = C; FOR(i, 0, N + M - 1) { tmp.clear(); FOR(x, 0, N) { int y = i - x; if (y < 0 || y >= M) continue; tmp.PB(x * M + y); } add_or(tmp); C++; } S[1] = C; FOR(i, -(M - 1), N) { tmp.clear(); FOR(x, 0, N) { int y = x - i; if (y < 0 || y >= M) continue; tmp.PB(x * M + y); } add_or(tmp); C++; } S[2] = C; FOR(i, K, N + M - 1) { tmp.clear(); tmp.PB(i + S[0]); tmp.PB((i - K) + S[0]); add_and(tmp); C++; } S[3] = C; FOR(i, -(M - 1) + K, N) { tmp.clear(); tmp.PB(i + (M - 1) + S[1]); tmp.PB(i + (M - 1 - K) + S[0]); add_and(tmp); C++; } S[4] = C; tmp.clear(); FOR(i, S[2], S[4]) { tmp.PB(i); } add_or(tmp); return; }
#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...