# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
286388 | Vimmer | Highway Tolls (IOI18_highway) | C++14 | 254 ms | 262148 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "highway.h"
#include <bits/stdc++.h>
//#include "grader.h"
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("fast-math")
//#pragma GCC optimize("no-stack-protector")
#define F first
#define S second
#define sz(x) int(x.size())
#define pb push_back
#define pf push_front
#define N 100005
#define M ll(998244353)
#define inf 1e9 + 1e9
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef short int si;
typedef array <ll, 3> a3;
typedef array <ll, 4> a4;
vector <pair <int, int> > g[N];
vector <int> vr;
void dfs(int v, int p)
{
for (auto it : g[v])
{
if (it.F == p) continue;
vr.pb(it.S);
dfs(it.F, v);
}
}
void find_pair (int n, vector <int> u, vector <int> v, int a, int b)
{
bool f = 1;
for (int i = 0; i < n - 1; i++)
{
if (u[i] != i || v[i] != i + 1) f = 0;
g[u[i]].pb({v[i], i});
g[v[i]].pb({u[i], i});
}
dfs(0, -1);
int l = 0, r = n - 2;
while (l < r)
{
int md = (l + r) >> 1;
vector <int> a; a.clear();
for (int i = 0; i < n - 1; i++) a.pb(0);
ll sm = ask(a);
for (int i = md; i < n - 1; i++) a[i] = 1;
ll smr = ask(a);
if (sm != smr) r = md - 1;
else l = md;
}
answer(0, v[l]);
}
컴파일 시 표준 에러 (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... |