Submission #851478

# Submission time Handle Problem Language Result Execution time Memory
851478 2023-09-20T00:02:22 Z abcvuitunggio Vision Program (IOI19_vision) C++17
0 / 100
21 ms 2816 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
int xr[201],xc[201],r[201],c[201],od[401],od2[401];
vector <int> v,vr,vc,vd;
void construct_network(int H, int W, int K){
    for (int i=0;i<H;i++){
        v.clear();
        for (int j=0;j<W;j++)
            v.push_back(i*W+j);
        xr[i]=add_xor(v);
        r[i]=add_or(v);
        v.clear();
        for (int j=max(0,i-K+1);j<=i;j++)
            v.push_back(xr[j]);
        int X=add_not(add_xor(v));
        v.clear();
        for (int j=max(i-K,0);j<=i;j++)
            v.push_back(r[j]);
        vr.push_back(add_and({X,add_or(v)}));
    }
    for (int i=0;i<W;i++){
        v.clear();
        for (int j=0;j<H;j++)
            v.push_back(j*W+i);
        xc[i]=add_xor(v);
        c[i]=add_or(v);
        v.clear();
        for (int j=max(i-K+1,0);j<=i;j++)
            v.push_back(xc[j]);
        int X=add_not(add_xor(v));
        v.clear();
        for (int j=max(i-K,0);j<=i;j++)
            v.push_back(c[j]);
        int Y=add_or(v);
        vc.push_back(add_and({X,Y}));
    }
    for (int i=0;i<H+W-1;i++){
        v.clear();
        for (int j=max(i-W+1,0);j<=min(i,H-1);j++)
            v.push_back(j*(W-1)+i);
        od[i]=add_or(v);
        v.clear();
        for (int j=max(0,H-i-1);j<min(H,H+W-i-1);j++)
            v.push_back(j*(W+1)+i-H+1);
        od2[i]=add_or(v);
        if (i>=K){
            vd.push_back(add_and({od[i],od[i-K]}));
            vd.push_back(add_and({od2[i],od2[i-K]}));
        }
    }
    add_and({add_and({add_or(vr),add_or(vc)}),add_or(vd)});
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB on inputs (0, 1), (0, 2), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB on inputs (0, 1), (0, 2), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB on inputs (0, 1), (0, 2), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB on inputs (0, 1), (0, 2), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 344 KB on inputs (0, 197), (0, 198), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 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 21 ms 2816 KB on inputs (126, 120), (176, 169), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB on inputs (0, 1), (0, 2), expected 1, but computed 0
2 Halted 0 ms 0 KB -