제출 #1069407

#제출 시각아이디문제언어결과실행 시간메모리
1069407allin27x로봇 (IOI13_robots)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

int putaway(int a, int b, int t, int X[], int Y[], int W[], int S[]){
    sort(X, X+a); sort(Y, Y+b);
    sort(W, W+t);
    if (W[t-1] > X[a-1]) return -1;
    int mc = a-1; int toy = t-1; int cnt = 0;
    vector<int> exc(a, 0);
    while (mc){
        while (X[mc-1] < W[toy]) toy--, cnt++;
        exc[mc] = cnt; cnt = 0; mc--;
    }
    exc[mc] = toy+1;
    for (int i=0; i<a; i++) cout<<exc[i]<<' ';
    int ans = 1;
    for (int i=a-2; i>=0; i--) exc[i] = exc[i+1]+exc[i];
    for (int i=0; i<a; i++) ans = max(ans, exc[i]/(a-i));

    return ans;
}
/*
5
0
9
1 5 10 15 20
1 0
2 0
3 0
5 0
8 0
12 0
14 0
19 0
20 0
*/

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

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