제출 #243233

#제출 시각아이디문제언어결과실행 시간메모리
243233Kubin곤돌라 (IOI14_gondola)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int valid(int n, int A[]) { int k = -1; for(int i = 0; i < n and k == -1; i++) if(A[i] <= n) k = (n + i - (A[i]-1)) % n; if(k != -1) rotate(A, A + k, A + n); for(int i = 0; i < n; i++) if(A[i] <= n and A[i]-1 != i) return false; return true; } int replacement(int n, int A[], int out[]) { } int countReplacement(int n, int A[]) { }

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

gondola.cpp: In function 'int replacement(int, int*, int*)':
gondola.cpp:22:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
gondola.cpp: In function 'int countReplacement(int, int*)':
gondola.cpp:27:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
/tmp/ccAZ8EaF.o: In function `main':
grader.cpp:(.text.startup+0xc3): undefined reference to `countReplacement'
grader.cpp:(.text.startup+0xe2): undefined reference to `valid'
grader.cpp:(.text.startup+0x106): undefined reference to `replacement'
collect2: error: ld returned 1 exit status