# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
978573 | akacool445k | Bridges (APIO19_bridges) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
// #define int long long
const long long mod = 1e9 + 7;
const long long shrek = (1 << 30);
const int gay = 5e4 + 10;
set<pair<pair<int, int>, int>> adj[gay];
bool vis[gay];
vector<int> cur;
void dfs(int x, int w) {
if(vis[x] == 1 || y.ff.ss < w) return;
vis[x] = 1;
cur.push_back(x);
for(auto y : adj[x]) {
// if(vis[y.ff.ff] == 1 || y.ff.ss < w) {
// continue;
// }
dfs(y.ff.ff, w);
}
}
signed main() {
int n, m, q;
cin >> n >> m;
int u[m + 5], v[m + 5], w[m + 5];
for(int i = 1; i <= m; i++) {
cin >> u[i] >> v[i] >> w[i];
adj[u[i]].insert({{v[i], w[i]}, i});