Submission #290207

#TimeUsernameProblemLanguageResultExecution timeMemory
290207rocks03Vision Program (IOI19_vision)C++14
33 / 100
3 ms1148 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define pld pair<long double, int> #define pii pair<int, int> #define pll pair<ll, ll> #define pb push_back #define ff first #define ss second #define SZ(x) ((int)(x).size()) #define ld long double mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int add_and(vector<int> Ns); int add_or(vector<int> Ns); int add_xor(vector<int> Ns); int add_not(int N); int H, W; bool valid(int x, int y){ return (x >= 0 && x < H && y >= 0 && y < W); } void construct_network(int H, int W, int K){ ::H = H, ::W = W; vector<int> all; int cnt = 0; for(int i = 0; i < H; i++){ for(int j = 0; j < W; j++){ for(int k = 0; k <= K; k++){ int i2 = i + k; int j2 = j + K - k; if(valid(i2, j2)){ vector<int> v(2); v[0] = W*i + j; v[1] = W*i2 + j2; add_and(v); all.pb(H*W+cnt); cnt++; } i2 = i + k; j2 = j - (K - k); if(valid(i2, j2)){ vector<int> v(2); v[0] = W*i + j; v[1] = W*i2 + j2; add_and(v); all.pb(H*W+cnt); cnt++; } i2 = i - k; j2 = j + K - k; if(valid(i2, j2)){ vector<int> v(2); v[0] = W*i + j; v[1] = W*i2 + j2; add_and(v); all.pb(H*W+cnt); cnt++; } i2 = i - k; j2 = j - (K - k); if(valid(i2, j2)){ vector<int> v(2); v[0] = W*i + j; v[1] = W*i2 + j2; add_and(v); all.pb(H*W+cnt); cnt++; } } } } add_or(all); }
#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...