# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
6083 | 2014-06-19T17:18:02 Z | baneling100 | 어르신 집배원 (BOI14_postmen) | C++ | 16 ms | 12288 KB |
#include <stdio.h> #include <algorithm> #include <vector> using namespace std; typedef pair <int,int> ppair; vector <ppair> A[500001]; int N, M, Ban[500001], Ans[500001], Top; void input(void) { int i, u, v; scanf("%d %d",&N,&M); for(i=1 ; i<=M ; i++) { scanf("%d %d",&u,&v); A[u].push_back(make_pair(v,i)); A[v].push_back(make_pair(u,i)); } } void process(int now) { int i, j=A[now].size(); for(i=0 ; i<j ; i++) if(Ban[A[now][i].second]==0) { Ban[A[now][i].second]=1; process(A[now][i].first); } Ans[++Top]=now; } void output(void) { int i; for(i=1 ; i<Top ; i++) printf("%d ",Ans[i]); } int main(void) { input(); process(1); output(); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 12032 KB | Output is correct |
2 | Incorrect | 14 ms | 12032 KB | Same junction appears twice in a route |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 15 ms | 12032 KB | Output is correct |
2 | Incorrect | 16 ms | 12052 KB | Same junction appears twice in a route |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 12032 KB | Output is correct |
2 | Incorrect | 13 ms | 12288 KB | Same junction appears twice in a route |
3 | Halted | 0 ms | 0 KB | - |