Submission #358251

# Submission time Handle Problem Language Result Execution time Memory
358251 2021-01-25T08:59:07 Z blue ICC (CEOI16_icc) C++11
Compilation error
0 ms 0 KB
#include "icc.h"
#include <set>
using namespace std;
 
void run(int N)
{
    set<int> edge[N+1];
 
    for(int i = 1; i <= N-1; i++)
    {
        bool flag = 0;
        for(int p = 1; p <= N; p++)
        {
            for(int q = p+1; q <= N; q++)
            {
                if(edge[p].find(q) != edge[p].end()) continue;
              
                if(query(1, 1, {p}, {q}) == 0) continue;
                edge[p].insert(q);
                edge[q].insert(p);
                setRoad(p, q);
                flag = 1;
                break;
            }
            if(flag) break;
        }
    }
}

Compilation message

icc.cpp: In function 'void run(int)':
icc.cpp:18:40: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   18 |                 if(query(1, 1, {p}, {q}) == 0) continue;
      |                                        ^
      |                                        |
      |                                        int
In file included from icc.cpp:1:
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:18:40: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   18 |                 if(query(1, 1, {p}, {q}) == 0) continue;
      |                                        ^
      |                                        |
      |                                        int
In file included from icc.cpp:1:
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);
      |                                 ~~~~~^