Submission #869773

# Submission time Handle Problem Language Result Execution time Memory
869773 2023-11-05T15:36:08 Z gutzzy ICC (CEOI16_icc) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "icc.h"
using namespace std;

vector<vector<bool>> lst;

pair<int,int> guess(int n){
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            if(lst[i][j]==false){
                if(query(1,1,{i+1},{j+1})) return {i,j};
            }
        }
    }
    return {0,0};
}

void run(int n){
    int roads = 0;
    lst = vector<vector<bool>>(n,vector<bool>(n, false));
    for(int i=0;i<n;i++) lst[i][i]=true;
    while(roads<n-1){
        pair<int,int> road = guess(n);
        setRoad(road.first,road.second);
        lst[road.first][road.second] = true;
        lst[road.second][road.first] = true;
        roads++;
    }
}

Compilation message

icc.cpp: In function 'std::pair<int, int> guess(int)':
icc.cpp:11:41: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   11 |                 if(query(1,1,{i+1},{j+1})) return {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:11:41: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   11 |                 if(query(1,1,{i+1},{j+1})) return {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);
      |                                 ~~~~~^