Submission #203869

# Submission time Handle Problem Language Result Execution time Memory
203869 2020-02-22T18:14:14 Z medk Vision Program (IOI19_vision) C++14
0 / 100
6 ms 888 KB
#include <bits/stdc++.h>
#include "vision.h"

#define pb push_back
#define ll long long
#define x first
#define y second

using namespace std;

int h,w;

int id(int y, int x)
{
    return y*w+x;
}

void construct_network(int H, int W, int k)
{
    h=H, w=W;
    vector<int> orY, orX, orT, orB;
    for(int i=0;i<h;i++)
    {
        vector<int> ln;
        for(int j=0;j<w;j++) ln.pb(id(i,j));
        orY.pb(add_or(ln));
    }
    for(int i=0;i<w;i++)
    {
        vector<int> ln;
        for(int j=0;j<h;j++) ln.pb(id(j,i));
        orX.pb(add_or(ln));
    }
    for(int i=0;i<h+w-1;i++)
    {
        vector<int> ln,ln2;
        for(int j=0;j<=i;j++) ln.pb(id(i-j,j)), ln2.pb(id(h-1-i+j,j));
        orT.pb(add_or(ln)), orB.pb(add_or(ln2));
    }
    vector<int> poss;
    for(int i=0;i<h+w-1-k;i++)
        poss.pb(add_and(vector<int>{orT[i], orT[i+k]})), poss.pb(add_and(vector<int>{orB[i], orB[i+k]}));
    int fst=add_or(poss);
    vector<int> wishnot;
    vector<int> wb,hb;
    for(int i=w-1;i>=k;i--) wb.pb(orX[i]);
    for(int i=0;i<w-k-1;i++)
    {
        wb.pop_back();
        int tmpor=add_or(wb);
        wishnot.pb(add_and(vector<int>{orX[i],tmpor}));
    }
    for(int i=h-1;i>=k;i--) hb.pb(orY[i]);
    for(int i=0;i<h-k-1;i++)
    {
        hb.pop_back();
        int tmpor=add_or(hb);
        wishnot.pb(add_and(vector<int>{orY[i],tmpor}));
    }
    int tm=add_or(wishnot);
    int wishn=add_not(tm);
    add_and(vector<int>{wishn,fst});
    return;
}
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 376 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 888 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -