#include #define MOD 1000000007 using namespace std; typedef pair P; typedef pair> PP; typedef long long LL; const double EPS = 1e-8; const int INF = 1e9; int dy[] = {0,1,0,-1}; int dx[] = {1,0,-1,0}; struct edge{ int to,cost,tm; }; int used[51]; int bfs(vector>& es,int C,int G){ //時間、コスト、どこにいるか priority_queue,greater> pq; pq.push(make_pair(0,make_pair(C,0))); used[0] = 1; int ret = INF; while(!pq.empty()){ PP pp = pq.top();pq.pop(); if(pp.second.second == G)ret = min(ret,pp.first); for(int i=0;i>es; cin >> N >> C >> V; es.resize(N); vector S(V),T(V),Y(V),M(V); for(int i=0;i> S[i]; for(int i=0;i> T[i]; for(int i=0;i> Y[i]; for(int i=0;i> M[i]; for(int i=0;i> a(N,vector(M,-1)); //diff < (./a.out < input.txt) output.txt // sort(v.begin(),v.end(),greater());