Submission #424314

#TimeUsernameProblemLanguageResultExecution timeMemory
424314flappybirdVision Program (IOI19_vision)C++14
0 / 100
34 ms3376 KiB
#include "vision.h" #include <bits/stdc++.h> #include <unordered_map> #pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("avx,avx2,fma") using namespace std; typedef int ll; ll H_, W_; unordered_map<ll, vector<ll>> sum, sub; unordered_map<ll, ll> sum_, sub_; ll getloc(ll x, ll y) { return x * W_ + y; } void construct_network(int H, int W, int K) { H_ = H; W_ = W; ll i, j; ll s = 100000000, e = 0; for (i = 0; i < H; i++) { for (j = 0; j < W; j++) { sum[i + j].push_back(getloc(i, j)); sub[i - j].push_back(getloc(i, j)); e = max(e, i - j); s = min(s, i - j); } } unordered_map<ll, vector<ll>>::iterator it; for (it = sum.begin(); it != sum.end(); it++) sum_[it->first] = add_or(it->second); for (it = sub.begin(); it != sub.end(); it++) sub_[it->first] = add_or(it->second); vector<ll> res; for (i = 0; i + K <= W + H - 2; i++) { vector<ll> v; v.push_back(sum_[i]); v.push_back(sum_[i + K]); res.push_back(add_and(v)); } for (i = s; i + K <= e; i++) { vector<ll> v; v.push_back(sub_[i]); v.push_back(sub_[i + K]); res.push_back(add_and(v)); } vector<ll> nres; for (i = 0; i <= W + H - 2; i++) { vector<ll> v; for (j = i + K + 1; j <= W + H - 2; j++) v.push_back(sum_[j]); if (v.empty()) break; vector<ll> vv; vv.push_back(add_or(v)); vv.push_back(sum_[i]); nres.push_back(add_and(vv)); } for (i = s; i <= e; i++) { vector<ll> v; for (j = i + K + 1; j <= e; j++) v.push_back(sub_[j]); if (v.empty()) break; vector<ll> vv; vv.push_back(add_or(v)); vv.push_back(sub_[i]); nres.push_back(add_and(vv)); } vector<ll> vvv; vvv.push_back(add_not(add_or(nres))); vvv.push_back(add_or(res)); add_and(vvv); }
#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...