Language: C++

#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt" > "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\b.answer"

typedef long long int Weight;
struct Edge {
	int src, dst;
	Weight weight;
	Edge(int src, int dst, Weight weight) :
		src(src), dst(dst), weight(weight) { }
};

bool operator < (const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
	e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
typedef vector<vector<pair<vector<int>, long long int>>>type;
int V, E, K;
 type time(const type&lts, const type&rts, const bool flag) {
	type squs(V,vector<pair<vector<int>,long long int>>(V));
	for (int i = 0; i < V; ++i) {
		for (int j = 0; j < V; ++j) {
			if (i == j)squs[i][j] = make_pair(vector<int>(), 0ll);
			else squs[i][j] = make_pair(vector<int>(), static_cast<long long>(-1e17));
		}
	}
	long long int amax = 0;
	for (int k = 0; k < V; ++k) {
		for (int i = 0; i < V; ++i) {
			for (int j = 0; j < V; ++j) {
				if (squs[i][j].second <lts[i][k].second + rts[k][j].second) {
					squs[i][j].second = lts[i][k].second + rts[k][j].second;
					amax = max(amax, squs[i][j].second);
					if (flag) {
						squs[i][j].first.clear();
						squs[i][j].first.insert(squs[i][j].first.end(), lts[i][k].first.begin(), lts[i][k].first.end());
						squs[i][j].first.insert(squs[i][j].first.end(), rts[k][j].first.begin(), rts[k][j].first.end());
					}
				}
			}
		}
	}
	return squs;
}
type square(const type&ts,bool flag) {
	const type lts(ts);
	const type rts(ts);
	return time(lts, rts, flag);
}

type power(const type&ts,const long long  int num,const bool flag) {
	assert(num);
	if (num == 1)return ts;
	else {
		type pot(square(power(ts,num/2,flag),flag));
		if (num % 2) {
			pot = time(pot, ts, flag);
		}
		return pot;
	}
}
vector<int>ans;
bool check(const type &ts,const long long int run,const int point,const bool flag) {
	
	type t(power(ts, run, flag&&run <= 100));
	long long int amax = 0;
	for (int i = 0; i < V; ++i) {
		for (int j = 0; j < V; ++j) {
			if (amax < t[i][j].second) {
				amax = t[i][j].second;
				if (run <= 100&&flag) {
					
					ans = t[i][j].first;
					ans.insert(ans.begin(), i);
				}
			}
		}
	}
	if (amax >= point)return true;
	else return false;
}

int main() { cin >> V >> E >> K;
	type times(V, vector<pair<vector<int>,long long int>>(V, make_pair(vector<int>(),static_cast<long long int>(-1e18))));
	for (int i = 0; i < E; ++i) {
		long long int a, b, c; cin >> a >> b >> c;

		times[a][b].second = max(times[a][b].second, c);
		times[a][b].first = vector<int>(1,b);
	}
	for (int i = 0; i < V; ++i) {
		times[i][i] = make_pair(vector<int>(1,i),0);
		
	}
	long long int amin = 1;
	long long int amax = 1e9;
	while (amin + 1 != amax) {
		long long int amid((amin + amax) / 2);
		if (check(times,amid, K)) {
			amax = amid;
		}
		else {
			amin = amid;
		}
	}
	if (amax > 1e8) {
		cout << -1 << endl;
	}
	else {
		check(times, amax, K);
		cout << amax << endl;
		if (amax <= 100) {
			for (int i = 0; i < ans.size(); ++i) {
				cout << ans[i];
				if (i != ans.size() - 1)cout << " ";
				else cout << endl;
			}
		}
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:109:26: error: too few arguments to function 'bool check(const type&, long long int, int, bool)'
  109 |                 if (check(times,amid, K)) {
      |                     ~~~~~^~~~~~~~~~~~~~~
a.cc:73:6: note: declared here
   73 | bool check(const type &ts,const long long int run,const int point,const bool flag) {
      |      ^~~~~
a.cc:120:22: error: too few arguments to function 'bool check(const type&, long long int, int, bool)'
  120 |                 check(times, amax, K);
      |                 ~~~~~^~~~~~~~~~~~~~~~
a.cc:73:6: note: declared here
   73 | bool check(const type &ts,const long long int run,const int point,const bool flag) {
      |      ^~~~~