# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1143423 | SmuggingSpun | Bridges (APIO19_bridges) | C++20 | 1868 ms | 9440 KiB |
#include<bits/stdc++.h>
#define taskname "B"
using namespace std;
int n, m, q;
namespace sub1{
void solve(){
vector<int>u(m + 1), v(m + 1), w(m + 1);
vector<vector<int>>g(n + 1);
for(int i = 1; i <= m; i++){
cin >> u[i] >> v[i] >> w[i];
g[u[i]].emplace_back(i);
g[v[i]].emplace_back(i);
}
cin >> q;
for(int _ = 0; _ < q; _++){
int _t, a, b;
cin >> _t >> a >> b;
if(_t == 1){
w[a] = b;
}
else{
vector<bool>vis(n + 1, false);
vis[a] = true;
queue<int>Q;
Q.push(a);
int ans = 1;
while(!Q.empty()){
int i = Q.front();
Q.pop();
for(int& index : g[i]){
Compilation message (stderr)
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |