제출 #869068

#제출 시각아이디문제언어결과실행 시간메모리
869068AtabayRajabli동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include "cave.h" long int a[5001], ans[5001], d[5001]; void exploreCave(int n) { int q = 0; for(int i = 0; i<n; i++) { a[i] = 0; ans[i] = 0; d[i] = 0; } int j = 0; while(j < n) { int q = tryCombination(a); for(; j<q; j++) { ans[j] = a[j]; d[j] = j; } if(j < n)a[j] ^= 1; } answer(ans, d); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:16:26: error: cannot convert 'long int*' to 'int*'
   16 |   int q = tryCombination(a);
      |                          ^
      |                          |
      |                          long int*
In file included from cave.cpp:1:
cave.h:8:24: note:   initializing argument 1 of 'int tryCombination(int*)'
    8 | int tryCombination(int S[]);
      |                    ~~~~^~~
cave.cpp:25:9: error: cannot convert 'long int*' to 'int*'
   25 |  answer(ans, d);
      |         ^~~
      |         |
      |         long int*
In file included from cave.cpp:1:
cave.h:9:17: note:   initializing argument 1 of 'void answer(int*, int*)'
    9 | void answer(int S[], int D[]);
      |             ~~~~^~~
cave.cpp:4:6: warning: unused variable 'q' [-Wunused-variable]
    4 |  int q = 0;
      |      ^