#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define f first
// #define s second
#define pb(x) push_back(x)
#define int long long
/*
ORDERED SET PDBS
#include <bits/extc++.h>
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
*/
const int MOD = 1e9+7;
const int inf = 1e9;
const int INF = 1e18+20;
const int LOG = 25;
void solve() {
int n, m;
cin>>n>>m;
int s, t, l, k;
cin>>s>>t>>l>>k;
s--; t--;
vector<vector<pair<int, int>>> adj(n);
for (int i=0; i<m; i++) {
int u, v, w;
cin>>u>>v>>w;
u--; v--;
adj[u].push_back({v, w});
adj[v].push_back({u, w});
}
cout<<adj[s].size() + adj[t].size() +1<<endl;
}
bool multi=false;
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t=1;
if (multi) cin>>t;
while (t--) solve();
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |