제출 #152685

#제출 시각아이디문제언어결과실행 시간메모리
152685Segtree자리 배치 (IOI18_seats)C++14
컴파일 에러
0 ms0 KiB
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
using namespace std;
typedef long long ll;
#define mod 1000000007
#define N 10010
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)
ll h,w,r[N],c[N];
void give_initial_chart(int H,int W,vector<ll> R,vector<ll> C){
    h=H,w=W;
    for(int i=1;i<=h*w;i++)r[i]=R[i];
    for(int i=1;i<=h*w;i++)c[i]=C[i];
}
int swap_seats(int a,int b){
    if(h*w>N)return 0;
    swap(r[a],r[b]);
    swap(c[a],c[b]);
    ll xl=1e17,xr=-1e17,yl=1e17,yr=-1e17;
    ll ans=0;
    for(int k=1;k<=h*w;k++){
	chmin(xl,r[k]);
	chmax(xr,r[k]);
	chmin(yl,c[k]);
	chmax(yr,c[k]);
	if((xr-xl+1)*(yr-yl+1)==k)ans++;
    }
    return ans;
}/*
int main(){
  
  return 0;
}*/

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

/tmp/cctOo3qS.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