| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 466799 | M4mou | 어르신 집배원 (BOI14_postmen) | C++17 | 723 ms | 80940 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
bool v[500005],queued[500005];
int next0[500005];
vector<vector<pair<int,int>>> graph;
int dfs(int x, int p){
    if(queued[x]){
        cout << x << " ";
        return x;
    }
    queued[x] = 1;
   // cout << x << endl;
    for(;next0[x]<graph[x].size();next0[x]++){
        auto edge = graph[x][next0[x]];
        if(v[edge.second] || p == x)continue;
        v[edge.second] = 1;
        int y = dfs(edge.first,x);
        if(x != y){
            queued[x] = 0;
            cout << x << " ";
            return y;
        }
        cout << '\n';
    }
    return -1;
}
int main(){
    
    int n,m;
    cin >> n >> m;
    graph.resize(n+1);
    while(m--){
        int x , y;
        cin >> x >> y;
        graph[x].push_back({y,m});
        graph[y].push_back({x,m});
    }
    for(int i = 1;i<=n;i++)dfs(i,-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... | ||||
