C++
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
int n, m, a, b;
double dis[100001];
vector <int> ph[100001]; // 出边序号
vector <int> pv[100001]; // 出边汇率
void dijkstra(int s)
{
bool vis[100001] = {};
memset(dis, 0, sizeof dis);
dis[s] = 1;
priority_queue <pair <double, int> > pq;
// priority_queue <pair <double, int>, vector <pair <double, int> >, greater <pair <double, int> > > pq;
pq.push({1, s});
while (! pq.empty())
{
auto t = pq.top();
pq.pop();
int v = t.second;
if (vis[v])
continue;
vis[v] = true;
for (int i = 0; i < ph[v].size(); i ++)
{
int j = ph[v][i];
if (dis[j] < dis[v] * (1 - pv[v][i] / 100.0))
{
dis[j] = dis[v] * (1 - pv[v][i] / 100.0);
pq.push({dis[j], j});
}
}
}
for (int i = 1; i <= n; i ++)
{
if (dis[i] == 0x3f3f3f3f)
dis[i] = INT_MAX;
}
}
int main()
{
ios :: sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n >> m;
for (int i = 1; i <= m; i ++)
{
int u, v, w;
cin >> u >> v >> w;
if (u == v)
continue;
ph[u].push_back(v);
pv[u].push_back(w);
}
cin >> a >> b;
dijkstra(a);
cout << fixed << setprecision(8) << 100 / dis[b] << endl;
return 0;
}