이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define inf 1000000000
#define ll long long
#define fi first
#define se second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define vp vector<pii>
#define SET(a, b) memset(a, b, sizeof(a))
#define all(x) (x).begin(), (x).end()
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
vi diag[500], diag2[500];
void construct_network(int h, int w, int k) {
FOR(i, 0, h-1) {
FOR(j, 0, w-1) {
diag[i+j].pb(i*w+j);
diag2[i+w-1-j].pb(i*w+j);
}
}
vi one, two;
FOR(i, 0, k-1) {
for (int j = i; j + k <= h + w - 2; j += k) {
vi query;
FOR(l, j, j + k) {
for (auto it: diag[l]) query.pb(it);
}
one.pb(add_xor({add_xor(query), add_or(query)}));
}
for (int j = i; j + k <= h + w - 2; j += k) {
vi query;
FOR(l, j, j + k) {
for (auto it: diag2[l]) query.pb(it);
}
two.pb(add_xor({add_xor(query), add_or(query)}));
}
}
int id = add_and({add_or(one), add_or(two)});
//----
one.clear();
two.clear();
k--;
FOR(i, 0, k-1) {
for (int j = i; j + k <= h + w - 2; j += k) {
vi query;
FOR(l, j, j + k) {
for (auto it: diag[l]) query.pb(it);
}
one.pb(add_xor({add_xor(query), add_or(query)}));
}
for (int j = i; j + k <= h + w - 2; j += k) {
vi query;
FOR(l, j, j + k) {
for (auto it: diag2[l]) query.pb(it);
}
two.pb(add_xor({add_xor(query), add_or(query)}));
}
}
int id2 = add_and({add_or(one), add_or(two)});
add_and({id, add_not(id2)});
}
# | 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... |