제출 #381835

#제출 시각아이디문제언어결과실행 시간메모리
381835thecodingwizard최후의 만찬 (IOI12_supper)C++11
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "assistant.h" using namespace std; #define f first #define s second void Assist(unsigned char *A, int N, int K, int R) { map<int, int> useLeft; int idx = 0; map<int, int> pos; map<int, int> revPos; queue<int> toRemove; for (int i = 0; i < K; i++) { int ct = 0; while (A[idx] != 0) { ct++; idx++; } idx++; useLeft[i] = ct; cout << i << " will be used " << ct << " times " << endl; if (ct == 0) toRemove.push(i); pos[i] = i; revPos[i] = i; } for (int i = 0; i < N; i++) { int req = GetRequest(); if (pos.count(req)) { useLeft[pos[req]]--; if (useLeft[pos[req]] == 0) { toRemove.push(pos[req]); } } else { int remove = toRemove.front(); toRemove.pop(); PutBack(revPos[remove]); pos.erase(revPos[remove]); revPos[remove] = req; pos[req] = remove; int ct = 0; if (idx == R) { ct = 10000000; } else { while (A[idx] != 0) { ct++; idx++; } idx++; } useLeft[remove] = ct; if (ct == 0) { toRemove.push(remove); } } } }

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

/tmp/ccytCpJJ.o: In function `Assist(unsigned char*, int, int, int)':
advisor.cpp:(.text+0x481): undefined reference to `GetRequest()'
advisor.cpp:(.text+0x565): undefined reference to `PutBack(int)'
/tmp/ccUDNWfD.o: In function `main':
advisor_grader.cpp:(.text.startup+0xde): undefined reference to `ComputeAdvice(int*, int, int, int)'
collect2: error: ld returned 1 exit status

/tmp/ccigwcGQ.o: In function `main':
assistant_grader.cpp:(.text.startup+0x23f): undefined reference to `Assist(unsigned char*, int, int, int)'
collect2: error: ld returned 1 exit status