Submission #203870

# Submission time Handle Problem Language Result Execution time Memory
203870 2020-02-22T18:21:12 Z medk Vision Program (IOI19_vision) C++14
0 / 100
30 ms 2424 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<=min(i,w-1);j++)
        {
            if(i-j<h) ln.pb(id(i-j,j));
            if(h-1-i+j>=0) 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 Correct 5 ms 256 KB Output is correct
2 Incorrect 5 ms 256 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Output is correct
2 Incorrect 5 ms 256 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Output is correct
2 Incorrect 5 ms 256 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Output is correct
2 Incorrect 5 ms 256 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 8 ms 632 KB Output is correct
2 Correct 6 ms 376 KB Output is correct
3 Correct 6 ms 376 KB Output is correct
4 Incorrect 5 ms 376 KB WA in grader: Instruction with no inputs
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 256 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 30 ms 2424 KB Output is correct
2 Incorrect 5 ms 364 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Output is correct
2 Incorrect 5 ms 256 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -