Submission #411396

# Submission time Handle Problem Language Result Execution time Memory
411396 2021-05-25T07:55:44 Z 조영욱(#7626) Vision Program (IOI19_vision) C++17
12 / 100
7 ms 1352 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;

int xpos[201];
int xval[201];
int xfinal[201];
int ypos[201];
int yval[201];
int yfinal[201];
int pval[401];
int mval[401];

void construct_network(int n,int m,int k) {
    vector<int> just;
    just.push_back(0);
    just.push_back(add_not(0));
    int one=add_xor(just);
    for(int i=0;i<n;i++) {
        vector<int> v;
        for(int j=0;j<m;j++) {
            v.push_back(i*m+j);
        }
        xpos[i]=add_or(v);
    }
    int save=add_not(one);
    for(int i=0;i<n;i++) {
        vector<int> v;
        for(int j=i;j<=i+k&&j<n;j++){
            v.push_back(xpos[j]);
        }
        vector<int> temp;
        temp.push_back(save);
        vector<int> temp2;
        temp2.push_back(add_not(add_xor(v)));
        temp2.push_back(add_or(v));
        temp.push_back(add_and(temp2));
        save=add_or(temp);
    }
    for(int j=0;j<m;j++) {
        vector<int> v;
        for(int i=0;i<n;i++) {
            v.push_back(i*m+j);
        }
        ypos[j]=add_or(v);
    }
    int save1=add_not(one);
    for(int i=0;i<m;i++) {
        vector<int> v;
        for(int j=i;j<=i+k&&j<m;j++){
            v.push_back(ypos[j]);
        }
        vector<int> temp;
        temp.push_back(save1);
        vector<int> temp2;
        temp2.push_back(add_not(add_xor(v)));
        temp2.push_back(add_or(v));
        temp.push_back(add_and(temp2));
        save1=add_or(temp);
    }
    vector<int> tmp;
    tmp.push_back(save);
    tmp.push_back(save1);
    int ret=add_or(tmp); //ret=0:이미 글렀음
    for(int i=0;i<=n+m-2;i++) {
        pval[i]=add_not(one);
        for(int x=0;x<n;x++) {
            int y=i-x;
            if (y<0||y>=m) {
                continue;
            }
            vector<int> temp;
            temp.push_back(pval[i]);
            temp.push_back(x*m+y);
            pval[i]=add_or(temp);
        }
    }
    for(int i=0;i<=n+m-2;i++) {
        mval[i]=add_not(one);
        int diff=i-m+1;
        for(int x=0;x<n;x++) {
            int y=x-diff;
            if (y<0||y>=m) {
                continue;
            }
            vector<int> temp;
            temp.push_back(mval[i]);
            temp.push_back(x*m+y);
            mval[i]=add_or(temp);
        }
    }
    int got=add_not(one);
    for(int i=0;i<=n+m-2;i++) {
        if (i+k<=n+m-2) {
            vector<int> v;
            v.push_back(pval[i]);
            v.push_back(pval[i+k]);
            int temp=add_and(v);
            vector<int> tmp;
            tmp.push_back(got);
            tmp.push_back(temp);
            got=add_or(tmp);
            v.clear();
            tmp.clear();
            v.push_back(mval[i]);
            v.push_back(mval[i+k]);
            temp=add_and(v);
            tmp.push_back(got);
            tmp.push_back(temp);
            got=add_or(tmp);
        }
    }
    vector<int> v;
    v.push_back(ret);
    v.push_back(got);
    add_and(v);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Incorrect 1 ms 204 KB on inputs (0, 2), (1, 0), expected 0, but computed 1
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Incorrect 1 ms 204 KB on inputs (0, 2), (1, 0), expected 0, but computed 1
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Incorrect 1 ms 204 KB on inputs (0, 2), (1, 0), expected 0, but computed 1
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Incorrect 1 ms 204 KB on inputs (0, 2), (1, 0), expected 0, but computed 1
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 460 KB Output is correct
2 Correct 5 ms 716 KB Output is correct
3 Correct 6 ms 716 KB Output is correct
4 Correct 7 ms 716 KB Output is correct
5 Correct 3 ms 460 KB Output is correct
6 Correct 5 ms 716 KB Output is correct
7 Correct 6 ms 784 KB Output is correct
8 Correct 6 ms 716 KB Output is correct
9 Correct 2 ms 460 KB Output is correct
10 Correct 4 ms 624 KB Output is correct
11 Correct 5 ms 716 KB Output is correct
12 Correct 5 ms 716 KB Output is correct
13 Correct 6 ms 716 KB Output is correct
14 Correct 7 ms 716 KB Output is correct
15 Correct 3 ms 460 KB Output is correct
16 Correct 4 ms 588 KB Output is correct
17 Correct 6 ms 716 KB Output is correct
18 Correct 5 ms 716 KB Output is correct
19 Correct 7 ms 716 KB Output is correct
20 Correct 6 ms 716 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 6 ms 876 KB Output is correct
4 Correct 6 ms 932 KB Output is correct
5 Correct 7 ms 968 KB Output is correct
6 Correct 7 ms 972 KB Output is correct
7 Correct 7 ms 968 KB Output is correct
8 Incorrect 3 ms 1096 KB WA in grader: Too many instructions
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 1352 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Incorrect 1 ms 204 KB on inputs (0, 2), (1, 0), expected 0, but computed 1
8 Halted 0 ms 0 KB -