Submission #1037170

#TimeUsernameProblemLanguageResultExecution timeMemory
1037170shmaxVision Program (IOI19_vision)C++17
0 / 100
5 ms1116 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; #define all(x) x.begin(), x.end() #define len(x) (int)(x.size()) template<typename T> using vec = vector<T>; void construct_network(int H, int W, int K) { // std::vector<int> Ns; // Ns = {0, 1}; // int a = add_and(Ns); // Ns = {0, a}; // int b = add_or(Ns); // Ns = {0, 1, b}; // int c = add_xor(Ns); // add_not(c); vec<int> rows; vec<int> columns; for (int i = 0; i < H; i++) { vec<int> v; for (int j = 0; j < W; j++) { v.push_back(i * W + j); } rows.push_back(add_or(v)); } for (int i = 0; i < W; i++) { vec<int> v; for (int j = 0; j < H; j++) { v.push_back(j * W + i); } columns.push_back(add_or(v)); } vec<int> pair_rows; vec<int> pair_columns; for (int i = 1; i < len(rows); i++) { pair_rows.push_back(add_and({rows[i], rows[i - 1]})); } for (int i = 1; i < len(columns); i++) { pair_columns.push_back(add_and({columns[i], columns[i - 1]})); } int xor1 = add_xor(rows); int xor2 = add_xor(columns); int t1 = add_or(pair_rows); int t2 = add_or(pair_columns); int ans1 = add_and({xor1, t2}); int ans2 = add_and({xor2, t1}); add_or({ans1, ans2}); }
#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...