# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
200563 | arnold518 | Vision Program (IOI19_vision) | C++14 | 27 ms | 2292 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 400;
int H, W, K, A[MAXN+10], B[MAXN+10];
int get(int y, int x)
{
y--; x--;
return W*y+x;
}
int solve(int K)
{
int i, j, p, q, x, y;
vector<int> t, tt;
for(p=2; p<=H+W; p++)
{
t.clear();
for(i=max(1, p-W); i<=min(p-1, H); i++)
{
j=p-i;
t.push_back(get(i, j));
}
A[p]=add_or(t);
}
for(p=2; p<=H+W; p++)
{
if(p==2) B[p]=A[p];
else B[p]=add_or({A[p], B[p-1]});
}
tt.clear();
for(p=K+2; p<=H+W; p++)
{
tt.push_back(add_and({B[p-K], A[p]}));
}
x=add_or(tt);
for(p=1-W; p<=H-1; p++)
{
t.clear();
for(i=max(1, p+1); i<=min(H, W+p); i++)
{
j=i-p;
t.push_back(get(i, j));
}
A[p+W]=add_or(t);
}
for(p=1-W; p<=H-1; p++)
{
if(p==1-W) B[p+W]=A[p+W];
else B[p+W]=add_or({A[p+W], B[p-1+W]});
}
tt.clear();
for(p=1-W+K; p<=H-1; p++)
{
tt.push_back(add_and({B[p-K+W], A[p+W]}));
}
y=add_or(tt);
return add_or({x, y});
}
void construct_network(int _H, int _W, int _K)
{
int i, j, p, q;
H=_H; W=_W; K=_K;
if(K==H+W-2)
{
solve(K);
return;
}
int x=solve(K), y=solve(K+1);
add_xor({x, y});
}
Compilation message (stderr)
# | 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... |