제출 #82526

#제출 시각아이디문제언어결과실행 시간메모리
82526farukkastamonuda자리 배치 (IOI18_seats)C++14
컴파일 에러
0 ms0 KiB
#include "seats.h" #include <bits/stdc++.h> #define fi first #define se second #define lo long long #define inf 1000000009 #define md 1000000007 #define li 200005 #define mp make_pair #define pb push_back #define mid (start+end)/2 using namespace std; int A[105][105],n,m; pair<int,int> konum[10005]; void give_initial_chart(int H,int W,int R[],int C[]){ n=H; m=W; for(int i=0;i<H*W;i++){ int sat=i/W; int sut=i%W; A[sat][sut]=i; konum[i]=mp(sat,sut); } } int swap_seats(int a,int b){ int cev=0; int sat1=konum[a].fi,sut1=konum[a].se; int sat2=konum[b].fi,sut2=konum[b].se; int temp=A[sat1][sut1]; konum[temp]=mp(sat2,sut2); konum[b]=mp(sat1,sut1); A[sat1][sut1]=A[sat2][sut2]; A[sat2][sut2]=temp; int sifs=konum[0].fi,sifsu=konum[0].se; for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ int mx=abs(i-sifs)*abs(j-sifsu)-1; int flag=0; for(int k=min(i,sifs);k<max(sifs,i);k++){ for(int t=min(j,sifsu);t<max(j,sifsu);t++){ if(A[k][t]>mx){ flag=1; break; } } if(flag==1) break; } if(flag==0) cev++; } } return cev; } //~ int main(){ //~ return 0; //~ }

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

/tmp/cc1vgBaO.o: In function `main':
grader.cpp:(.text.startup+0x183): undefined reference to `give_initial_chart(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status