Submission #869786

# Submission time Handle Problem Language Result Execution time Memory
869786 2023-11-05T16:29:19 Z ElenaBM ICC (CEOI16_icc) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "icc.h"
using namespace std;
void subsets(vector<vector<bool>>&matriz, int n){
    for (int i = 1; i <= n; ++i){
        int sub1 = i;
        vector<int>sub2;
        for (int j = 1; j <= n; ++j){
            if (i == j or matriz[i][j] == true){
                continue;
            }
            else sub2.push_back(j);
        }
        if (query(1, (int)sub2.size(), sub1, sub2)){
            vector<int>opt;
            int r = (int)sub2.size() - 1, l = 0;
            while (l < r){
                int m = (l+r)/2;
                opt.clear();
                for (int i= 0; i <= m; ++i)opt.push_back(sub2[i]);
                if (query(1, (int)opt.size(), sub1, opt)) r = m;
                else l = m+1;
            }
            setRoad(sub1, opt[l]);
            matriz[sub1][opt[l]] = true;
            matriz[opt[l]][sub1] = true;
            return;
        }
    }
}
void run (int n){
    vector<vector<bool>>matriz(n+1, vector<bool>(n+1, false));
    for (int i = 0; i < n-1; ++i){
        subsets (matriz, n);
    }
    
}

Compilation message

icc.cpp: In function 'void subsets(std::vector<std::vector<bool> >&, int)':
icc.cpp:14:40: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   14 |         if (query(1, (int)sub2.size(), sub1, sub2)){
      |                                        ^~~~
      |                                        |
      |                                        int
icc.cpp:14:46: error: cannot convert 'std::vector<int>' to 'int*'
   14 |         if (query(1, (int)sub2.size(), sub1, sub2)){
      |                                              ^~~~
      |                                              |
      |                                              std::vector<int>
In file included from icc.cpp:2:
icc.h:10:38: note:   initializing argument 4 of 'int query(int, int, int*, int*)'
   10 | int query(int a, int b, int *A, int *B);
      |                                 ~~~~~^
icc.cpp:21:47: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   21 |                 if (query(1, (int)opt.size(), sub1, opt)) r = m;
      |                                               ^~~~
      |                                               |
      |                                               int
icc.cpp:21:53: error: cannot convert 'std::vector<int>' to 'int*'
   21 |                 if (query(1, (int)opt.size(), sub1, opt)) r = m;
      |                                                     ^~~
      |                                                     |
      |                                                     std::vector<int>
In file included from icc.cpp:2:
icc.h:10:38: note:   initializing argument 4 of 'int query(int, int, int*, int*)'
   10 | int query(int a, int b, int *A, int *B);
      |                                 ~~~~~^