# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1172438 | DanielPr8 | Railway (BOI17_railway) | C++20 | 236 ms | 30900 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvl = vector<vll>;
using pll = pair<ll,ll>;
using vpl = vector<pll>;
using vvp = vector<vpl>;
#define f first
#define s second
#define pb push_back
#define all(v) v.begin(),v.end()
vector<map<ll,ll>> wh;
vll am, col;
void uni(ll a, ll b){
if(wh[a].size()<wh[b].size()){
uni(b,a);
swap(wh[a],wh[b]);
swap(am[a],am[b]);
return;
}
for(auto [c,d]:wh[b]){
if(wh[a][c]==0)am[a]++;
wh[a][c]+=d;
if(wh[a][c]==col[c])am[a]--;
}
}
int main(){
# | 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... |