제출 #585841

#제출 시각아이디문제언어결과실행 시간메모리
585841Dan4Life로봇 (IOI13_robots)C++17
컴파일 에러
0 ms0 KiB
//#include "robots.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define pii pair<int,int> #define fi first #define se second #define all(a) a.begin(), a.end() #define sz(a) (int)a.size() const int INF = (int)1e9; vector<pii> weak, small, toy; bool work(int i, int j, int type){ if(type==0) return weak[i].fi>=toy[j].fi; return small[i].se>=toy[j].se; } int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) { for(int i = 0; i < A; i++) weak.pb({X[i],INF}); for(int i = 0; i < B; i++) small.pb({INF,Y[i]}); for(int i = 0; i < T; i++) toy.pb({W[i],S[i]}); sort(all(weak)), sort(all(small)), sort(all(toy)); if(A==0){ if(work(0,0,1) and work(1,1,1)) return 1; if(work(1,0,1) and work(1,1,1)) return 2; return -1; } else if(B==0){ if(work(0,0,0) and work(1,1,0)) return 1; if(work(1,0,0) and work(1,1,0)) return 2; return -1; } else{ if(work(0,0,0) and work(1,1,1)) return 1; if(work(1,0,0) and work(0,1,1)) return 1; if(work(0,0,0) and work(1,1,0)) return 2; if(work(0,0,1) and work(1,1,1)) return 2; return -1; } }

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

/usr/bin/ld: /tmp/ccwoFDv5.o: in function `main':
grader.c:(.text.startup+0x1b1): undefined reference to `putaway'
collect2: error: ld returned 1 exit status