Submission #147074

# Submission time Handle Problem Language Result Execution time Memory
147074 2019-08-27T12:24:00 Z Bodo171 Vision Program (IOI19_vision) C++14
0 / 100
14 ms 1936 KB
#include "vision.h"
#include <iostream>
using namespace std;
const int nmax=1005;
vector<int> d1[nmax],d2[nmax];
int wh1[nmax],wh2[nmax],ps1[nmax],ps2[nmax];
int nr,n,m,i,j;
int enc(int i,int j)
{
    return n*i+m;
}
int solve(int k)
{
    vector<int> arg;
    for(i=k;i<=n+m-2;i++)
        arg.push_back(add_and({wh1[i],ps1[i-k]}));
    for(i=k+1;i<=n+m-1;i++)
        arg.push_back(add_and({wh2[i],ps2[i-k]}));
    return add_and(arg);
}
void construct_network(int H, int W, int K) {
	vector<int> Ns;
	nr=H*W-1;
	n=H,m=W;
	for(i=0;i<H;i++)
        for(j=0;j<W;j++)
    {
        d1[i+j].push_back(enc(i,j));
        d2[j-i+H].push_back(enc(i,j));
    }
	for(i=0;i<=H+W-2;i++)
    {
        wh1[i]=add_or(d1[i]);
        if(i==0) ps1[i]=wh1[i];
        else ps1[i]=add_or({ps1[i-1],wh1[i]});
    }
    for(i=1;i<=H+W-1;i++)
    {
        wh2[i]=add_or(d2[i]);
        if(i==1) ps2[i]=wh1[i];
        else ps2[i]=add_or({ps2[i-1],wh2[i]});
    }
    Ns.push_back(solve(K));
    if(K+1<=H+W-2)Ns.push_back(solve(K+1));
    add_xor(Ns);
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 1936 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 Incorrect 2 ms 376 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -