# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
610971 | penguinhacker | Robot (JOI21_ho_t4) | C++17 | 992 ms | 82248 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 ll long long
#define ar array
const int mxN=1e5;
const ll INF=1e18;
int n, m;
ll dp1[mxN]; // no changed edges leading to this node
map<int, ll> dp2[mxN]; // must use this color
map<int, vector<ar<int, 2>>> adj[mxN];
map<int, ll> mp[mxN];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m;
for (int i=0; i<m; ++i) {
int u, v, c, w;
cin >> u >> v >> c >> w, --u, --v;
adj[u][c].push_back({v, w});
adj[v][c].push_back({u, w});
mp[u][c]+=w;
mp[v][c]+=w;
}
for (int i=0; i<n; ++i) {
dp1[i]=INF;
for (auto& x : adj[i])
dp2[i][x.first]=INF;
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... |