제출 #1298415

#제출 시각아이디문제언어결과실행 시간메모리
1298415gesp3011v2동굴 (IOI13_cave)C++20
컴파일 에러
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; vector<int> b; void exploreCave(int N){ int a[N]; b.resize(N); iota(b.begin(),b.end(),0); memset(a,0,sizeof a); do{ int ans=tryCombination(a); if(ans==-1)break; a[res]=1; }while(1); answer(a,b); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:14:7: error: 'res' was not declared in this scope
   14 |     a[res]=1;
      |       ^~~
cave.cpp:16:10: error: cannot convert 'std::vector<int>' to 'int*'
   16 | answer(a,b);
      |          ^
      |          |
      |          std::vector<int>
In file included from cave.cpp:1:
cave.h:9:26: note:   initializing argument 2 of 'void answer(int*, int*)'
    9 | void answer(int S[], int D[]);
      |                      ~~~~^~~