#include
<
iostream
>
using
namespace
std;
int
N;
int
map[
110
][
110
];
int
into[
110
];
int
main()
{
scanf(
"
%d
"
,
&
N);
int
k;
memset(map,
0
,
sizeof
(map));
memset(into,
0
,
sizeof
(into));
for
(
int
i
=
1
;i
<=
N;
++
i){
scanf(
"
%d
"
,
&
k);
while
(k){
map[i][k]
=
1
;
into[k]
++
;
scanf(
"
%d
"
,
&
k);
}
}
for
(
int
i
=
1
;i
<=
N;
++
i){
int
minj
=
0
;
for
(
int
j
=
1
;j
<=
N;
++
j)
if
(into[j]
==
0
){
minj
=
j;
break
;
}
if
(i
==
N) printf(
"
%d\n
"
,minj);
else
printf(
"
%d
"
,minj);
into[minj]
=
256
;
for
(
int
j
=
1
;j
<=
N;
++
j)
if
(map[minj][j])
into[j]
--
;
}
return
0
;
}
posted on 2009-05-27 17:20
xfstart07 阅读(116)
评论(0) 编辑 收藏 引用 所属分类:
代码库