# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
68758 | Talant | Simurgh (IOI17_simurgh) | C++17 | 30 ms | 23988 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "simurgh.h"
//#include "grader.cpp"
#include <bits/stdc++.h>
#define sc second
#define fr first
#define mk make_pair
#define pb push_back
using namespace std;
const int N = (1e6 + 5);
const int inf = (1e9 + 7);
vector <pair<int,int> > g[N];
vector <int> vec,ans;
int was[N];
int nn;
int f;
void dfs (int v) {
if (f) return;
was[v] = 1;
for (auto to : g[v]) {
if (!was[to.fr]) {
vec.pb(to.sc);
dfs(to.fr);
vec.pop_back();
}
}
was[v] = 0;
if (vec.size() == nn - 1) {
int o = count_common_roads(vec);
if (o == nn - 1) {
ans = vec;
f = 1;
return;
}
}
}
vector<int> find_roads(int n, vector<int> u, vector<int> v) {
nn = n;
for (int i = 0; i < u.size(); i ++) {
g[u[i]].pb(mk(v[i],i));
g[v[i]].pb(mk(u[i],i));
}
for (int i = 0; i < n; i ++) {
dfs(i);
if (f) return ans;
}
return ans;
}
컴파일 시 표준 에러 (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... |