<commit_before>#include <vector>
#include <list>
#include <limits>
#include <queue>
#include <functional>
#include <utility>

using namespace std;

struct Edge {
	Edge() : dst(0), len(0) {}
	Edge(int dst, int len) : dst(dst), len(len) {}
	int dst, len;
};

struct Graph {
	Graph(int N) : graph(N, list<Edge>()) {}
	void addEdge(int src, int dst, int len) { graph[src].push_back(Edge(dst, len)); }
	vector<list<Edge> > graph;
};

vector<int> Dijkstra(const Graph& G, int src)
{
	vector<bool> visited(G.graph.size(), false);
	vector<int> distance(G.graph.size(), numeric_limits<int>::max());
	vector<int> prev(G.graph.size(), -1);
	priority_queue<pair<int, int>, vector<pair<int, int> >, greater<pair<int, int> > > q;
	
	distance[src] = 0;
	q.push(make_pair(0, src));
	
	while (!q.empty()) {
		pair<int, int> entry = q.top(); q.pop();
		int cur = entry.second;
		if (visited[cur]) continue;
		for (list<Edge>::const_iterator it = G.graph[cur].begin(); it != G.graph[cur].end(); ++it) {
			if (visited[it->dst]) continue;
			if (distance[cur] + it->len < distance[it->dst]) {
				distance[it->dst] = distance[cur] + it->len;
				prev[it->dst] = cur;
				q.push(make_pair(distance[it->dst], it->dst));
			}
		}
		visited[cur] = true;
	}
	return prev;
}<commit_msg>Slightly smaller still Dijkstra's algorithm.<commit_after>#include <vector>
#include <list>
#include <limits>
#include <queue>
#include <functional>
#include <utility>

using namespace std;

struct Graph {
	Graph(int N) : graph(N, list<pair<int, int> >()) {}
	void addEdge(int src, int dst, int len) { graph[src].push_back(make_pair(dst, len)); }
	vector<list<pair<int, int> > > graph;
};

vector<int> Dijkstra(const Graph& G, int src)
{
	vector<bool> visited(G.graph.size(), false);
	vector<int> distance(G.graph.size(), numeric_limits<int>::max());
	vector<int> prev(G.graph.size(), -1);
	priority_queue<pair<int, int>, vector<pair<int, int> >, greater<pair<int, int> > > q;
	
	distance[src] = 0;
	q.push(make_pair(0, src));
	
	while (!q.empty()) {
		pair<int, int> entry = q.top(); q.pop();
		int cur = entry.second;
		if (visited[cur]) continue;
		for (list<pair<int, int> >::const_iterator it = G.graph[cur].begin(); it != G.graph[cur].end(); ++it) {
			if (visited[it->first]) continue;
			if (distance[cur] + it->second < distance[it->first]) {
				distance[it->first] = distance[cur] + it->second;
				prev[it->first] = cur;
				q.push(make_pair(distance[it->first], it->first));
			}
		}
		visited[cur] = true;
	}
	return prev;
}
{'fraction_non_alphanumeric': 0.20856685348278622, 'fraction_numerical': 0.0032025620496397116, 'mean_word_length': 4.679545454545455, 'pattern_counts': {'":': 0, '<': 52, '<?xml version=': 0, '>': 66, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4099070', 'n_tokens_mistral': 1011, 'n_tokens_neox': 950, 'n_words': 214}