Submission #1026106

#TimeUsernameProblemLanguageResultExecution timeMemory
1026106HD1Vision Program (IOI19_vision)C++14
44 / 100
142 ms2896 KiB
#include "vision.h" #include<bits/stdc++.h> #define sz(x) ll(x.size()) #define all(x) x.begin(),x.end() #define pb push_back #define ff first #define ss second using namespace std; typedef long long ll; typedef pair<ll,ll> ii; const ll MAX=1e6; //ii mobs[10]={{1,1},{-1,-1},{1,-1},{-1,1},{0,1},{1,0},{-1, 0},{0, -1}}; int n, m, k; int dist(int a, int b, int i, int j){ return abs(a-i)+abs(b-j); } vector<int>s, p, q; void look(int a, int b){ for(int i=0; i<n; i++){ for(int j=0; j<m; j++){ if(dist(a,b,i,j)==k){ q.pb(i*m+j); } } } if(sz(q)<=0) return; p.pb(add_or(q)); p.pb(a*m+b); s.pb(add_and(p)); //1cout<<sz(s)<<' '<<sz(p)<<' '<<sz(q)<<'\n'; p.clear(); q.clear(); return; } void construct_network(int H, int W, int K){ n=H; m=W; k=K; for(int i=0; i<H; i++){ for(int j=0; j<W; j++){ look(i,j); } } add_or(s); 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...