Submission #604969

# Submission time Handle Problem Language Result Execution time Memory
604969 2022-07-25T11:34:43 Z Hazem ICC (CEOI16_icc) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "icc.h"

using namespace std;

const int N = 2e5+10;
int a[N],par[N];

int find_par(int x){

    if(x==par[x])
        return x;
    
    return par[x] = find_par(par[x]);
}

void run(int n){

    for(int i=1;i<=n;i++)
        par[i] = i;

    int T = n-1;
    while(T--){
        for(int i=1;i<=n;i++)
            for(int j=i+1;j<=n;j++)
                if(find_par(i)!=find_par(j)){
                    int v = query(1,1,{i},{j});
                    if(v){
                        setRoad(i,j);
                        par[j] = i;
                        break;
                    }
                }
    }    
}

Compilation message

icc.cpp: In function 'void run(int)':
icc.cpp:27:46: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   27 |                     int v = query(1,1,{i},{j});
      |                                              ^
      |                                              |
      |                                              int
In file included from icc.cpp:2:
icc.h:10:30: note:   initializing argument 3 of 'int query(int, int, int*, int*)'
   10 | int query(int a, int b, int *A, int *B);
      |                         ~~~~~^
icc.cpp:27:46: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   27 |                     int v = query(1,1,{i},{j});
      |                                              ^
      |                                              |
      |                                              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);
      |                                 ~~~~~^