제출 #1113770

#제출 시각아이디문제언어결과실행 시간메모리
1113770sunboi로봇 (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[]){ int ans = 0; sort(X, X + A); reverse(X, X + A); vector<pair<int, int>> a(T); bool f = 0; for (int i = 0; i < T; i++){ a[i] = {W[i], S[i]}; if (a[i].first >= X[0]) f = 1; } if (f) return -1; sort(a.begin(), a.end()); reverse(a.begin(), a.end()); int ini = 1, fin = T + 1; while(ini < fin){ int m = (ini + fin) / 2; int k = 0; int tiempo = 0; for (int i = 0; i < A; i++){ tiempo = 0; while(k < T && tiempo < m && X[i] > a[k].first){ k++; tiempo++; } } if (k == T){ fin = m; }else ini = m + 1; } return ini; }

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

robots.cpp: In function 'int putaway(int, int, int, int*, int*, int*, int*)':
robots.cpp:6:9: warning: unused variable 'ans' [-Wunused-variable]
    6 |     int ans = 0;
      |         ^~~
/usr/bin/ld: /tmp/ccLXmIRc.o: in function `main':
grader.c:(.text.startup+0x1b1): undefined reference to `putaway'
collect2: error: ld returned 1 exit status