Submission #1070302

#TimeUsernameProblemLanguageResultExecution timeMemory
1070302GrayVision Program (IOI19_vision)C++17
44 / 100
11 ms3024 KiB
#include "vision.h" #include<bits/stdc++.h> using namespace std; #define ll int #define ff first #define ss second #define ln "\n" #define ld long double ll h, w, k; ll encode(ll i, ll j){ return i*w+j; } pair<ll,ll> decode(ll x){ return {x/w, x%w}; } vector<pair<ll, ll>> mult = {{1, 1}, {-1, -1}, {-1, 1}, {1, -1}}; void construct_network(int H, int W, int K) { h=H; w=W; k=K; vector<ll> fs; for (ll i=0; i<h; i++){ for (ll j=0; j<w; j++){ if (k==1 and (i+j)%2==0) continue; vector<ll> qry; for (ll ri=0; ri<=k; ri++){ ll rj = k-ri; for (auto mch:mult){ ll ni = i+mch.ff*ri, nj = j+mch.ss*rj; if (ni>=0 and ni<h and nj>=0 and nj<w){ qry.push_back(encode(ni, nj)); } } } if (!qry.size()) continue; fs.push_back(add_and({add_or(qry), encode(i, j)})); } } add_or(fs); }
#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...