| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 559584 | stefantaga | 어르신 집배원 (BOI14_postmen) | C++14 | 597 ms | 18908 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
struct wow
{
int x,y;
}muchie[500005];
vector <pair <int,int>> v[500005];
int n,m,i,nr[500005],marc[500005],ok1,j,ok[500005];
int main()
{
ios_base :: sync_with_stdio(false);
cin.tie(0);
#ifdef HOME
ifstream cin("date.in");
ofstream cout("date.out");
#endif // HOME
cin>>n>>m;
for (i=1;i<=m;i++)
{
cin>>muchie[i].x>>muchie[i].y;
int x = muchie[i].x;
int y = muchie[i].y;
v[x].push_back({y,i});
v[y].push_back({x,i});
}
int q;
for (i=1;i<=n;i++)
{
q=0;
nr[++q]=i;
while (q)
{
int acum = nr[q];
marc[acum]=1;
ok1=0;
for (j=0;j<v[acum].size();j++)
{
int ind = v[acum][j].second;
if (ok[ind]==0)
{
ok[ind]=1;
if (marc[v[acum][j].first]==1)
{
while (nr[q]!=v[acum][j].first)
{
marc[nr[q]]=0;
cout<<nr[q]<<" ";
q--;
}
cout<<v[acum][j].first<<'\n';
}
else
{
nr[++q]=v[acum][j].first;
}
ok1=1;
break;
}
}
if (ok1==0)
{
q--;
}
}
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
