Submission #423969

# Submission time Handle Problem Language Result Execution time Memory
423969 2021-06-11T14:50:59 Z aymanrs Vision Program (IOI19_vision) C++14
0 / 100
20 ms 1968 KB
    #include <bits/stdc++.h> 
    #include "vision.h"
    using namespace std;
    void construct_network(int H, int W, int K){
        vector<int> ow, xw, ad, oc, xc;
        int f = -1, l = -1;
        for(int i = H-1;i > 0;i--){
            vector<int> o;
            for(int j = i;j < H && j - i < W;j++){
                o.push_back(j * W + j - i);
            }
            ow.push_back(add_or(o));
            xw.push_back(add_xor(o));
        }
        for(int i = 0;i < W;i++){
            vector<int> o;
            for(int j = i;j < W && j - i < H;j++){
                o.push_back((j - i) * W + j);
            }
            ow.push_back(add_or(o));
            xw.push_back(add_xor(o));
        }
        for(int i = 0;i < W;i++){
            vector<int> o;
            for(int j = i;j >= 0 && i - j < H;j--){
                o.push_back((i - j) * W + j);
            }
            oc.push_back(add_or(o));
            xc.push_back(add_xor(o));
        }
        for(int i = 1;i < H;i++){
            vector<int> o;
            for(int j = i;j < H && W - 1 - j + i >= 0;j++){
                o.push_back(j * W + W - 1 - j + i);
            }
            oc.push_back(add_or(o));
            xc.push_back(add_xor(o));
        }
        for(int i = 0;i < ow.size()-K;i++){
            ad.push_back(add_and({ow[i], ow[i+K]}));
        }
        f = add_and({add_not(add_or(xc)), add_or(ad)});
        ad.clear();
        for(int i = 0;i < oc.size()-K;i++){
            ad.push_back(add_and({oc[i], oc[i+K]}));
        }
        l = add_and({add_not(add_or(xw)), add_or(ad)});
        add_or({f, l});
    }

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:39:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   39 |         for(int i = 0;i < ow.size()-K;i++){
      |                       ~~^~~~~~~~~~~~~
vision.cpp:44:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   44 |         for(int i = 0;i < oc.size()-K;i++){
      |                       ~~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 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 204 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 204 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 204 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 332 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 204 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 20 ms 1968 KB on inputs (80, 199), (81, 199), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -