#include <cstdio> #include <cstdlib> #include <vector> #include <algorithm> using namespace std; vector<vector<int>* > paths; class Node { public: vector<int> child; int weight; Node(int w = 0) : weight(w){} }; int str2num(const char* str) { if (str == NULL) return 0; int v = 0; int i = 0; char ch; while ((ch = str[i++]) != '