Submission #625110

#TimeUsernameProblemLanguageResultExecution timeMemory
625110alexander707070자리 배치 (IOI18_seats)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #define MAXN 1000007 using namespace std; int n,m; pair<int,int> pos[MAXN]; int check(){ int minx=n+1,maxx=0,miny=m+1,maxy=0,res=0; for(int i=1;i<=n*m;i++){ minx=min(minx,pos[i].first); maxx=max(maxx,pos[i].first); miny=min(miny,pos[i].second); maxy=max(maxy,pos[i].second); if((maxx-minx)*(maxy-miny)==i)res++; } return res; } void give_initial_chart(int H, int W, int R[], int C[]){ n=H; m=W; for(int i=0;i<n*m;i++){ pos[i+1]={R[i],C[i]}; } } int swap_seats(int a, int b){ swap(pos[a],pos[b]); return check(); }

Compilation message (stderr)

/usr/bin/ld: /tmp/cc5rriCo.o: in function `main':
grader.cpp:(.text.startup+0x22f): 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