제출 #418284

#제출 시각아이디문제언어결과실행 시간메모리
418284FlippenFazHighway Tolls (IOI18_highway)C++11
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; void answer(int s, int t); ll ask(vector<int> w); set<int> curCities; void find_pair(int N, vector<int> U, vector<int> V, int A, int B) { vector<int> askArr; askArr.resize(U.size()); ll sml = ask(askArr); askArr[0] = 1; ll cur = ask(askArr); if (cur > sml) { curCities.insert(U[0]); curCities.insert(V[0]); } for (int i = 1; i < askArr.size(); i++) { U[i-1] = 0; U[i] = 1; ll cur = ask(askArr); if (cur > sml) { if (curCities.erase(U[i]) == 0) { curCities.insert(U[i]); } if (curCities.erase(V[i]) == 0) { curCities.insert(V[i]); } } } vector<int> cits; for (auto it = curCities.begin(); it != curCities.end(); it++) { cits.push_back(*it); } answer(cits[0], cits[1]); }

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

highway.cpp: In function 'void find_pair(int, std::vector<int>, std::vector<int>, int, int)':
highway.cpp:21:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |     for (int i = 1; i < askArr.size(); i++) {
      |                     ~~^~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/ccG6w2T3.o: in function `find_pair(int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, int, int)':
highway.cpp:(.text+0x221): undefined reference to `ask(std::vector<int, std::allocator<int> >)'
/usr/bin/ld: highway.cpp:(.text+0x2b7): undefined reference to `ask(std::vector<int, std::allocator<int> >)'
/usr/bin/ld: highway.cpp:(.text+0x389): undefined reference to `ask(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status