# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
420982 | marcipan5000 | Friend (IOI14_friend) | 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.
for (int i=1;i<n;i++) {
if (protocol[i]==0) {
t[i].push_back(host[i]);
t[host[i]].push_back(i);
}
if (protocol[i]==1) {
uu=t[host[i]].size();
for (int j=0;j<uu;j++) {
t[i].push_back(t[host[i]][j]);
t[t[host[i]][j]].push_back(i);
}
}
if (protocol[i]==2) {
uu=t[host[i]].size();
for (int j=0;j<uu;j++) {
t[i].push_back(t[host[i]][j]);
t[t[host[i]][j]].push_back(i);
}
t[i].push_back(host[i]);
t[host[i]].push_back(i);
}