이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "vision.h"
using namespace std;
int test (int n, int m, int k) {
vector<vector<int>> R(n + m - 1), L(n + m - 1);
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
L[i + j].push_back(i * m + j);
R[i - j + m - 1].push_back(i * m + j);
}
}
vector<int> HaveR(n + m - 1), PrefHaveR(n + m - 1);
vector<int> HaveL(n + m - 1), PrefHaveL(n + m - 1);
vector<int> ask;
for (int i = 0; i < n + m - 1; ++i) {
HaveR[i] = add_or(R[i]);
HaveL[i] = add_or(L[i]);
PrefHaveR[i] = i ? add_or({PrefHaveR[i - 1], HaveR[i]}) : HaveR[i];
PrefHaveL[i] = i ? add_or({PrefHaveL[i - 1], HaveL[i]}) : HaveL[i];
if (i >= k) {
ask.push_back(add_and({HaveR[i], PrefHaveR[i - k]}));
ask.push_back(add_and({HaveL[i], PrefHaveL[i - k]}));
}
}
return (ask.empty() ? add_and({0, add_not(0)}) : add_or(ask));
}
void construct_network(int H, int W, int K) {
add_xor({test(H, W, K), test(H, W, K + 1)});
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |