Submission #1038765

#TimeUsernameProblemLanguageResultExecution timeMemory
1038765AmirAli_H1Vision Program (IOI19_vision)C++17
0 / 100
83 ms8908 KiB
// In the name of Allah #include <bits/stdc++.h> #include "vision.h" using namespace std; typedef long long int ll; typedef long double ld; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef complex<ld> cld; #define all(x) (x).begin(),(x).end() #define len(x) ((ll) (x).size()) #define F first #define S second #define pb push_back #define sep ' ' #define endl '\n' #define Mp make_pair #define kill(x) cout << x << '\n', exit(0) #define set_dec(x) cout << fixed << setprecision(x); #define file_io(x,y) freopen(x, "r", stdin); freopen(y, "w", stdout); mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); const int maxlg = 9; int n, m, k; vector<int> ls1, ls2, vc; vector<int> ls, lsx; int GI(int i, int j) { return (i * m) + j; } void construct_network(int H, int W, int K) { n = H; m = W; k = K; for (int i = n - 1; i >= 0; i--) { vc.clear(); for (int j = 0; j < n; j++) vc.pb(GI(i, j)); if (len(ls1) >= 1) vc.pb(ls1.back()); ls1.pb(add_xor(vc)); } for (int j = m - 1; j >= 0; j--) { vc.clear(); for (int i = 0; i < n; i++) vc.pb(GI(i, j)); if (len(ls2) >= 1) vc.pb(ls2.back()); ls2.pb(add_xor(vc)); } for (int x : ls1) ls.pb(x); for (int x : ls2) ls.pb(x); for (int j = 0; j < maxlg; j++) { if (k & (1 << j)) lsx.pb(add_xor(ls)); else lsx.pb(add_not(add_xor(ls))); vc.clear(); ls1.clear(); ls2.clear(); for (int i = 0; i < len(ls); i++) { vc.pb(ls[i]); ls1.pb(add_xor(vc)); } for (int i = 0; i < len(ls); i++) { if (i == 0) ls2.pb(add_and({ls[i]})); else ls2.pb(add_and({ls[i], ls1[i - 1]})); } ls = ls2; } add_and(lsx); }
#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...