Submission #1030886

# Submission time Handle Problem Language Result Execution time Memory
1030886 2024-07-22T11:23:41 Z vjudge1 Rooted MST (innopolis2021_final_E) C++17
0 / 100
291 ms 12628 KB
#include <bits/stdc++.h>
using namespace std;

#define int long long
#define f first
#define s second

mt19937 gnd(time(NULL));

void solve(){
    int n, m;
    cin >> n >> m;
    int ans = 0;

    vector<int> v(n-1);
    for(int i = 0; i < n-1; i++){
        int a, b;
        cin >> a >> b;
        cin >> v[i];
        ans+=v[i];
    }
    int q;
    cin >> q;
    while(q--){
        int r, p;
        cin >> r >> p;
        ans-=v[r-1];
        v[r-1]=p;
        ans+=p;
        cout << ans << endl;
    }

}


signed main(){
    int t = 1;
    // cin >> t;
    while(t--) solve();

}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 291 ms 9032 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 167 ms 11604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 167 ms 11604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 198 ms 12628 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -