Submission #778743

# Submission time Handle Problem Language Result Execution time Memory
778743 2023-07-10T16:00:00 Z jasmin Vision Program (IOI19_vision) C++17
0 / 100
2 ms 1968 KB
#include "vision.h"
#include<bits/stdc++.h>
using namespace std;

void construct_network(int H, int W, int K){
    
    //find_nums
    vector<int> xorh(H);
    for(int i=0; i<H; i++){
        
        vector<int> ns;
        for(int j=0; j<W; j++){
            ns.push_back(i*W + j);
        }

        xorh[i] = add_xor(ns);
    }
    for(int i=1; i<H; i++){
        xorh[i] = add_xor({xorh[i], xorh[i-1]});
    }

    vector<int> bitsh(20);
    for(int i=0; i<20; i++){
        bitsh[i] = add_xor(xorh);

        for(int j=0; j<H; j++){
            if((j>>i)%2==0){
                
                xorh[i] = add_xor({xorh[i], xorh[i]});
            }
        }
    }


    vector<int> xorw(W);
    for(int i=0; i<W; i++){

        vector<int> ns;
        for(int j=0; j<H; j++){
            ns.push_back(j*W + i);
        }

        xorw[i] = add_xor(ns);
    }
    for(int i=1; i<W; i++){
        xorw[i] = add_xor({xorw[i-1], xorw[i]});
    }

    vector<int> bitsw(20);
    for(int i=0; i<20; i++){
        bitsw[i] = add_xor(xorw);

        for(int j=0; j<W; j++){
            if((j>>i)%2==0){

                xorw[j] = add_xor({xorw[j], xorw[j]});
            }
        }
    }

    // add
    vector<int> bits;
    int carry=xorw[0];
    for(int i=0; i<20; i++){

        bits[i] = add_xor({bitsw[i], bitsh[i], carry});
        carry = add_or({add_and({bitsw[i], bitsh[i]}), add_and({bitsw[i], carry}), add_and({bitsh[i], carry})});
    }

    // compare
    vector<int> bitsk(20);
    for(int i=0; i<20; i++){

        bitsk[i] = (K>>i)%2;
    }

    vector<int> same(20);
    for(int i=0; i<20; i++){
        same[i] = add_not(add_xor({bits[i], bitsk[i]}));
    }
    add_and(same);
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 1968 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -