# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
480937 | peti1234 | 경주 (Race) (IOI11_race) | C++17 | 522 ms | 101504 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int c=200005;
int szint[c], ki[c];
long long dist[c], cel, ans=c;
map<long long, long long> m[c];
vector<pair<int, int> > sz[c];
bool v[c];
void unio(int a, int b) {
int aa=ki[a], bb=ki[b], sa=m[aa].size(), sb=m[bb].size();
long long ert=cel+2*dist[a];
if (sa>=sb) {
for (auto p:m[bb]) {
long long fi=p.first, se=p.second, inv=ert-fi;
if (m[aa].find(inv)!=m[aa].end()) {
ans=min(ans, se+m[aa][inv]-2*szint[a]);
}
}
for (auto p:m[bb]) {
long long fi=p.first, se=p.second;
if (m[aa].find(fi)!=m[aa].end()) {
m[aa][fi]=min(m[aa][fi], se);
} else {
m[aa][fi]=se;
}
}
} else {
ki[a]=bb;
# | 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... |