제출 #869773

#제출 시각아이디문제언어결과실행 시간메모리
869773gutzzyICC (CEOI16_icc)C++14
컴파일 에러
0 ms0 KiB
#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++; } }

컴파일 시 표준 에러 (stderr) 메시지

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);
      |                                 ~~~~~^