# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
388524 | 2021-04-11T21:49:05 Z | JimmyZJX | Vision Program (IOI19_vision) | C++14 | 13 ms | 1944 KB |
#include <iostream> #include <fstream> #include <algorithm> #include <cstring> #include <climits> #include <cassert> #include <tuple> #include <queue> #include <stack> #include <vector> #include <map> #include <set> #include <string> using namespace std; typedef long long LL; typedef vector<int> Vi; typedef vector<bool> Vb; typedef vector<vector<int>> Vii; #define forR(i, n) for (int i = 0; i < (n); i++) int add_not(int N); void Get_le_k(Vi& rs, Vi& d1r, int K, int& dd1_le_k); int add_and(Vi Ns); int add_or(Vi Ns); int add_xor(Vi Ns); int Get_le_k(const Vi& dr, int K) { Vi rs; for (int i = 0; i < dr.size() - K; i++) { Vi range; // [i, i+K] for (int j = 0; j <= K; j++) { range.push_back(i + j); } int or_range = add_or(range); int xor_range = add_xor(range); rs.push_back(add_and(Vi{ or_range, add_not(xor_range) })); } int dd_ge1_leK = add_or(rs); int dd_eq0 = add_not(add_or(dr)); return add_or(Vi{ dd_eq0, dd_ge1_leK }); } void construct_network(int H, int W, int K) { // d1[i] x+y == i d2[i] x+(W-1-y) == i Vii d1(H + W - 1), d2(H + W - 1); forR(x, H) forR(y, W) { int index = x * W + y; int i1 = x + y, i2 = x + (W - 1 - y); d1[i1].push_back(index); d2[i2].push_back(index); } Vi d1r, d2r; for (auto& d1_line : d1) { d1r.push_back(add_xor(d1_line)); } for (auto& d2_line : d2) { d2r.push_back(add_xor(d2_line)); } int dd1_eq_k, dd1_le_k, dd2_eq_k, dd2_le_k; // d1 { Vi rs; for (int i = 0; i < d1r.size() - K; i++) { rs.push_back(add_and(Vi{ d1r[i], d1r[i + K] })); } dd1_eq_k = add_or(rs); dd1_le_k = Get_le_k(d1r, K); } // d2 { Vi rs; for (int i = 0; i < d2r.size() - K; i++) { rs.push_back(add_and(Vi{ d2r[i], d2r[i + K] })); } dd2_eq_k = add_or(rs); dd2_le_k = Get_le_k(d2r, K); } int dd1_k = add_and(Vi{ dd1_le_k, dd2_le_k }); //int dd1_k = add_and(Vi{ dd1_eq_k, dd2_le_k }); //int dd2_k = add_and(Vi{ dd2_eq_k, dd1_le_k }); //add_or(Vi{ dd1_k, dd2_k }); return; } #ifdef TEST_LOCAL int add_not(int N) { return -1; } int add_and(Vi Ns) { return -1; } int add_or(Vi Ns) { return -1; } int add_xor(Vi Ns) { return -1; } int main() { construct_network(200, 200, 1); return 0; } #endif
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Incorrect | 0 ms | 204 KB | on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Incorrect | 0 ms | 204 KB | on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Incorrect | 0 ms | 204 KB | on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Incorrect | 0 ms | 204 KB | on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 460 KB | Output is correct |
2 | Incorrect | 5 ms | 716 KB | on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | on inputs (0, 0), (1, 0), expected 1, but computed 0 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 1944 KB | on inputs (80, 199), (81, 199), expected 1, but computed 0 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Incorrect | 0 ms | 204 KB | on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 | Halted | 0 ms | 0 KB | - |