제출 #483276

#제출 시각아이디문제언어결과실행 시간메모리
483276MohamedAliSaidane동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef vector<int> vi; typedef vector<ll> vll; #define pb push_back #define pop pop_back #define ff first #define ss second const ll MOD = 1e9 + 7; const ll INF = 1e18; int n; void exploreCave(int N) { n = N; vll cb(n,0); ll u = tryCombination(cb); vll d; d.assign(n,0); bool visited[n]; ll cnt = 0; memset(visited,false,sizeof(visited)); while(cnt < n) { for(int i = 0; i<n; i ++) { if(visited[i]) continue; cb[i] = 1; ll um = tryCombination(cb); if(um < u) { visited[i] = true; cb[i] = 0; d[um] = i; cnt ++; } else if(um > u) { visited[i] = true; d[um] = i; u = um; cnt ++; } else cb[i] = 0; } } answer(cb,d); return ; }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:26:27: error: cannot convert 'vll' {aka 'std::vector<long long int>'} to 'int*'
   26 |     ll u = tryCombination(cb);
      |                           ^~
      |                           |
      |                           vll {aka std::vector<long long int>}
In file included from cave.cpp:2:
cave.h:8:24: note:   initializing argument 1 of 'int tryCombination(int*)'
    8 | int tryCombination(int S[]);
      |                    ~~~~^~~
cave.cpp:38:36: error: cannot convert 'vll' {aka 'std::vector<long long int>'} to 'int*'
   38 |             ll um = tryCombination(cb);
      |                                    ^~
      |                                    |
      |                                    vll {aka std::vector<long long int>}
In file included from cave.cpp:2:
cave.h:8:24: note:   initializing argument 1 of 'int tryCombination(int*)'
    8 | int tryCombination(int S[]);
      |                    ~~~~^~~
cave.cpp:57:12: error: cannot convert 'vll' {aka 'std::vector<long long int>'} to 'int*'
   57 |     answer(cb,d);
      |            ^~
      |            |
      |            vll {aka std::vector<long long int>}
In file included from cave.cpp:2:
cave.h:9:17: note:   initializing argument 1 of 'void answer(int*, int*)'
    9 | void answer(int S[], int D[]);
      |             ~~~~^~~