# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
484552 | MohamedFaresNebili | Easter Eggs (info1cup17_eastereggs) | C++14 | 5 ms | 492 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
/// #pragma GCC optimize ("Ofast")
/// #pragma GCC target ("avx2")
using namespace std;
using ll = long long;
using vi = vector<int>;
#define pb push_back
#define ff first
#define ss second
#define lb lower_bound
#define all(x) (x).begin() , (x).end()
#include "grader.h"
vector<int>adj[555], id; int timer, tin[555], out[555];
void dfs(int v, int p) {
tin[v] = timer++; id.pb(v);
for(auto u: adj[v]) {
if(u == p) continue;
dfs(u, v);
}
out[v] = timer - 1;
}
int findEgg (int N, vector < pair < int, int > > bridges)
{
for(int l = 1; l <= N; l++) adj[l].clear(); id.clear();
for(auto u : bridges) {
int a = u.ff, b = u.ss;
adj[a].pb(b); adj[b].pb(a);
}
timer = 0; dfs(1, 1);
int lo = 0, hi = N - 1;
for(;;) {
vector<int>arr;
for(int l = tin[id[lo]]; l <= out[id[lo]]; l++) arr.pb(id[l]);
bool ok = query(arr);
if(ok) {
if(tin[id[lo]] == out[id[lo]]) return id[lo];
hi = out[id[lo]], lo++;
}
else lo = out[id[lo]] + 1;
}
}
컴파일 시 표준 에러 (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... |