Submission #1126831

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11268312024-12-15 11:13:28BlancaHMSaveit (IOI10_saveit)C++17
Compilation error
0 ms0 KiB
#include <queue>
#include <vector>
using namespace std;
vector<int> shortest_path_to_all_cities(int source, vector<vector<int>> & adjacency) {
// Calculate length of shortest path from source to all cities in graph.
int num_cities = (int) adjacency.size();
vector<int> distances(num_cities, num_cities + 1);
distances[source] = 0;
queue<int> bfs_queue;
bfs_queue.push(source);
while (!bfs_queue.empty()) {
int city = bfs_queue.front();
bfs_queue.pop();
for (int & neighbour: adjacency[city]) {
if (distances[neighbour] > distances[city] + 1) {
distances[neighbour] = distances[city] + 1;
bfs_queue.push(neighbour);
}
}
}
return distances;
}
vector<vector<int>> calculate_distances_to_hubs(vector<vector<int>> & adjacency, int num_hubs) {
// Calculate length of shortest paths from all hubs to all cities in graph.
vector<vector<int>> distances(num_hubs);
for (int i = 0; i < num_hubs; i++) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

# 1번째 컴파일 단계

encoder.cpp: In function 'void encode_in_bits(int, int)':
encoder.cpp:64:5: error: 'encode_bit' was not declared in this scope; did you mean 'encode_in_bits'?
   64 |     encode_bit(bit);
      |     ^~~~~~~~~~
      |     encode_in_bits