# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
26872 | 2017-07-06T16:32:49 Z | top34051 | 어르신 집배원 (BOI14_postmen) | C++14 | 500 ms | 23416 KB |
#include<bits/stdc++.h> using namespace std; #define maxn 500005 int n,m; int out[maxn]; bool vis[maxn]; vector<pair<int,int> > from[maxn]; stack<pair<int,int> > st; void dfs(int x,int last) { int i,y; if(out[x]) { while(!st.empty()) { y = st.top().first; printf("%d ",y); out[y]--; st.pop(); if(y==x) break; } printf("\n"); } for(i=0;i<from[x].size();i++) { if(!vis[from[x][i].second]) { out[x]++; st.push({x,from[x][i].first}); vis[from[x][i].second] = 1; dfs(from[x][i].first,x); } } } main() { int i,x,y; scanf("%d%d",&n,&m); for(i=1;i<=m;i++) { scanf("%d%d",&x,&y); from[x].push_back({y,i}); from[y].push_back({x,i}); } dfs(1,0); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 11 ms | 12032 KB | Output is correct |
2 | Correct | 13 ms | 12160 KB | Output is correct |
3 | Correct | 11 ms | 12160 KB | Output is correct |
4 | Correct | 16 ms | 12392 KB | Output is correct |
5 | Correct | 12 ms | 12160 KB | Output is correct |
6 | Correct | 13 ms | 12416 KB | Output is correct |
7 | Correct | 27 ms | 13568 KB | Output is correct |
8 | Correct | 13 ms | 12288 KB | Output is correct |
9 | Correct | 127 ms | 20704 KB | Output is correct |
10 | Correct | 17 ms | 12160 KB | Output is correct |
11 | Correct | 13 ms | 12288 KB | Output is correct |
12 | Correct | 89 ms | 21160 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 12032 KB | Output is correct |
2 | Correct | 11 ms | 12152 KB | Output is correct |
3 | Correct | 14 ms | 12032 KB | Output is correct |
4 | Correct | 14 ms | 12416 KB | Output is correct |
5 | Correct | 15 ms | 12136 KB | Output is correct |
6 | Correct | 15 ms | 12592 KB | Output is correct |
7 | Correct | 20 ms | 13568 KB | Output is correct |
8 | Correct | 12 ms | 12288 KB | Output is correct |
9 | Correct | 159 ms | 20756 KB | Output is correct |
10 | Correct | 18 ms | 12220 KB | Output is correct |
11 | Correct | 13 ms | 12288 KB | Output is correct |
12 | Correct | 91 ms | 21112 KB | Output is correct |
13 | Correct | 91 ms | 23396 KB | Output is correct |
14 | Correct | 94 ms | 19204 KB | Output is correct |
15 | Execution timed out | 1088 ms | 21828 KB | Time limit exceeded |
16 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 12160 KB | Output is correct |
2 | Correct | 11 ms | 12160 KB | Output is correct |
3 | Correct | 12 ms | 12160 KB | Output is correct |
4 | Correct | 16 ms | 12288 KB | Output is correct |
5 | Correct | 13 ms | 12160 KB | Output is correct |
6 | Correct | 14 ms | 12544 KB | Output is correct |
7 | Correct | 22 ms | 13568 KB | Output is correct |
8 | Correct | 12 ms | 12288 KB | Output is correct |
9 | Correct | 130 ms | 20728 KB | Output is correct |
10 | Correct | 13 ms | 12160 KB | Output is correct |
11 | Correct | 15 ms | 12416 KB | Output is correct |
12 | Correct | 84 ms | 21132 KB | Output is correct |
13 | Correct | 102 ms | 23416 KB | Output is correct |
14 | Correct | 99 ms | 19220 KB | Output is correct |
15 | Execution timed out | 1094 ms | 21868 KB | Time limit exceeded |
16 | Halted | 0 ms | 0 KB | - |