Submission #306166

# Submission time Handle Problem Language Result Execution time Memory
306166 2020-09-24T18:45:06 Z hhh07 Vision Program (IOI19_vision) C++14
0 / 100
36 ms 3832 KB
#include <iostream>
#include <vector>
#include <cmath>
#include <queue>
#include "vision.h"

using namespace std;


void construct_network(int h, int w, int k){
    vector<int> left[500], right[500];

    for (int i = 0; i < h; i++){
        for (int j = 0; j < w; j++){
            left[i + j].push_back(i*w + j);
            right[i - j + w - 1].push_back(i*w + j);
        }
    }
        
    int l1[500], l2[500], r1[500], r2[500];
    for (int i = 0; i < h + w - 1; i++){
        l1[i] = add_or(left[i]);
        r1[i] = add_or(right[i]);
        l2[i] = add_xor({add_xor(left[i]), add_or(left[i])});
        r2[i] = add_xor({add_xor(right[i]), add_or(right[i])});
    }
    vector<int> l, r;
    for (int i = 0; i + k + 1 < h + w - 1; i++){
        vector<int> twos, ones;
        for (int j = i; j < i + k + 1; j++){
            twos.push_back(l2[j]);
            ones.push_back(l1[j]);
        }
        twos.push_back(add_xor({add_xor(ones), add_or(ones)}));
        l.push_back(add_or(twos));
    }
    
    for (int i = 0; i + k + 1 < h + w - 1; i++){
        vector<int> twos, ones;
        for (int j = i; j < i + k + 1; j++){
            twos.push_back(r2[j]);
            ones.push_back(r1[j]);
        }
        twos.push_back(add_xor({add_xor(ones), add_or(ones)}));
        r.push_back(add_or(twos));
    }
    int moze_kplusjedan = add_and({add_or(l), add_or(r)});
    l.clear(); r.clear();
    for (int i = 0; i + k < h + w - 1; i++){
        vector<int> twos, ones;
        for (int j = i; j < i + k; j++){
            twos.push_back(l2[j]);
            ones.push_back(l1[j]);
        }
        twos.push_back(add_xor({add_xor(ones), add_or(ones)}));
        l.push_back(add_or(twos));
    }
    
    for (int i = 0; i + k < h + w - 1; i++){
        vector<int> twos, ones;
        for (int j = i; j < i + k; j++){
            twos.push_back(r2[j]);
            ones.push_back(r1[j]);
        }
        twos.push_back(add_xor({add_xor(ones), add_or(ones)}));
        r.push_back(add_or(twos));
    }
    int moze_k = add_and({add_or(l), add_or(r)});
    
    int rj = add_and({moze_kplusjedan, add_not(moze_k)});
    return;
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:70:9: warning: unused variable 'rj' [-Wunused-variable]
   70 |     int rj = add_and({moze_kplusjedan, add_not(moze_k)});
      |         ^~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 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 1 ms 384 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 1 ms 384 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 1 ms 384 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 4 ms 768 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 1 ms 384 KB on inputs (0, 0), (1, 0), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 36 ms 3832 KB Output is correct
2 Incorrect 1 ms 384 KB on inputs (0, 0), (1, 0), expected 1, but computed 0
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -