| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 903567 | 12345678 | 통행료 (IOI18_highway) | C++17 | 87 ms | 9960 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "highway.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int nx=1e5+5;
int id[nx], t, vs[nx], res[nx];
vector<pair<int, int>> d[nx];
void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B) {
vector<int> qs(N-1);
for (int i=0; i<U.size(); i++) d[U[i]].push_back({V[i], i}), d[V[i]].push_back({U[i], i});
ll length=ask(qs)/A;
queue<int> q;
q.push(0);
vs[0]=1;
while (!q.empty())
{
int u=q.front();
q.pop();
for (auto [v, idx]:d[u]) if (!vs[v]) res[t]=v, id[t++]=idx, vs[v]=1, q.push(v);
}
int l=0, r=N-1;
while (l<r)
{
int md=(l+r)/2;
for (int i=0; i<N-1; i++) qs[i]=0;
for (int i=0; i<=md; i++) qs[id[i]]=1;
if (ask(qs)/B==length) r=md;
else l=md+1;
}
answer(0, res[l]);
}
/*
4 3 1 2 0 3
0 1
0 2
1 3
*/
컴파일 시 표준 에러 (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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
