Submission #152204

# Submission time Handle Problem Language Result Execution time Memory
152204 2019-09-06T18:55:00 Z stefdasca Vision Program (IOI19_vision) C++14
Compilation error
0 ms 0 KB
#include "vision.h"
#include<bits/stdc++.h>

using namespace std;
int query_number
vector<int>fct(int K, vector<int>mn)
{
    vector<int>k1;
    for(int i = K; i < mn.size(); ++i)
    {
        if(i + 1 < mn.size())
        {
            add_xor({add_and({mn[i-K], mn[i]}), add_and({mn[i-K], mn[i+1]})});
            query_number += 3;
        }
        else
        {
            add_xor({add_and({mn[i-K], mn[i]})});
            query_number += 2;
        }
        k1.push_back(query_number);
    }
    return k1;
}
void construct_network(int H, int W, int K)
{
    query_number = H * W - 1;
    vector<int>mn, sc;
    for(int i = H - 1; i >= 0; --i)
    {
        vector<int>pz;
        for(int a = i, b = 0; a < H && b < W; ++a, ++b)
            pz.push_back(a * W + b);
        if(i == H-1)
            add_xor(pz), ++query_number;
        else
            add_xor({query_number, add_xor(pz)}), query_number += 2;
        mn.push_back(query_number);
    }
    for(int i = 1; i < W; ++i)
    {
        vector<int>pz;
        for(int a = 0, b = i; a < H && b < W; ++a, ++b)
            pz.push_back(a * W + b);
        add_xor({query_number, add_xor(pz)}), query_number += 2;
        mn.push_back(query_number);
    }
    for(int i = 0; i < W; ++i)
    {
        vector<int>pz;
        for(int a = 0, b = i; a < H && b >= 0; ++a, --b)
            pz.push_back(a * W + b);
        if(i == 0)
            add_xor(pz), ++query_number;
        else
            add_xor({query_number, add_xor(pz)}), query_number += 2;
        sc.push_back(query_number);
    }
    for(int i = 1; i < H; ++i)
    {
        vector<int>pz;
        for(int a = i, b = W - 1; a < H && b >= 0; ++a, --b)
            pz.push_back(a * W + b);
        add_xor({query_number, add_xor(pz)});
        query_number += 2;
        sc.push_back(query_number);
    }
    add_and({add_or(fct(K, mn)), add_or(fct(K, sc)), add_not(add_or(fct(K+1, mn))), add_not(add_or(fct(K+1, sc)))});
}

Compilation message

vision.cpp:6:1: error: expected initializer before 'vector'
 vector<int>fct(int K, vector<int>mn)
 ^~~~~~
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:27:5: error: 'query_number' was not declared in this scope
     query_number = H * W - 1;
     ^~~~~~~~~~~~
vision.cpp:37:48: error: could not convert '{query_number, add_xor(std::vector<int>(pz))}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
             add_xor({query_number, add_xor(pz)}), query_number += 2;
                                                ^
vision.cpp:45:44: error: could not convert '{query_number, add_xor(std::vector<int>(pz))}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
         add_xor({query_number, add_xor(pz)}), query_number += 2;
                                            ^
vision.cpp:56:48: error: could not convert '{query_number, add_xor(std::vector<int>(pz))}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
             add_xor({query_number, add_xor(pz)}), query_number += 2;
                                                ^
vision.cpp:64:44: error: could not convert '{query_number, add_xor(std::vector<int>(pz))}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
         add_xor({query_number, add_xor(pz)});
                                            ^
vision.cpp:68:21: error: 'fct' was not declared in this scope
     add_and({add_or(fct(K, mn)), add_or(fct(K, sc)), add_not(add_or(fct(K+1, mn))), add_not(add_or(fct(K+1, sc)))});
                     ^~~
vision.cpp:68:21: note: suggested alternative: 'fcvt'
     add_and({add_or(fct(K, mn)), add_or(fct(K, sc)), add_not(add_or(fct(K+1, mn))), add_not(add_or(fct(K+1, sc)))});
                     ^~~
                     fcvt
vision.cpp:68:115: error: could not convert '{<expression error>, <expression error>, <expression error>, <expression error>}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
     add_and({add_or(fct(K, mn)), add_or(fct(K, sc)), add_not(add_or(fct(K+1, mn))), add_not(add_or(fct(K+1, sc)))});
                                                                                                                   ^