제출 #534854

#제출 시각아이디문제언어결과실행 시간메모리
534854bonk로봇 (IOI13_robots)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "robots.h" using namespace std; using ll = long long; ll putaway(ll a, ll b, ll t, vector<ll>x, vector<ll>y, vector<ll>w, vector<ll>s){ sort(x.begin(), x.end(), greater<ll>()); sort(y.begin(), y.end(), greater<ll>()); if(t == 2 && (a + b == 2)){ if(a == 2){ if((x[0] >= w[0] && x[1] >= w[1]) || (x[0] >= w[1] && x[1] >= w[0])){ return 1; } else if(x[0] >= w[0] && x[0] >= w[1]){ return 2; } else{ return -1; } } else if(b == 2){ if((y[0] >= s[0] && y[1] >= s[1]) || (y[0] >= s[1] && y[1] >= s[0])){ return 1; } else if(y[0] >= s[0] && y[0] >= s[1]){ return 2; } else{ return -1; } } else{ if((x[0] >= w[0] && y[0] >= s[1]) || (x[0] >= w[1] && y[0] >= s[0])){ return 1; } else if((x[0] >= w[0] && x[0] >= w[1]) || (y[0] >= s[0] && y[0] >= s[1])){ return 2; } else{ return -1; } } } return 0; } int main(){ ll a, b, t; cin >> a >> b >> t; vector<ll>x(a), y(b), w(t), s(t); for(int i = 0; i < a; i++) cin >> x[i]; for(int i = 0; i < b; i++) cin >> y[i]; for(int i = 0; i < t; i++) cin >> w[i] >> s[i]; cout << putaway(a, b, t, x, y, w, s) << endl; return 0; }

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

/usr/bin/ld: /tmp/ccdxM3ut.o: in function `main':
robots.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccGactGr.o:grader.c:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccGactGr.o: in function `main':
grader.c:(.text.startup+0x1b1): undefined reference to `putaway'
collect2: error: ld returned 1 exit status