Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n,i,j;
- cin>>n;
- int ara[n+3][n+3];
- for(i=1;i<=n;i++)
- {
- for(j=1;i<=n;i++)
- {
- ara[i][j]=0;
- }
- }
- int a,b,t;
- for( i=1;i<=n;i++)
- {
- cin>>a>>t;
- while(t--)
- {
- cin>>b;
- ara[a][b]=1;
- }
- }
- for( i=1;i<=n;i++)
- {
- for( j=1;j<=n;j++)
- {
- if(j==n)cout<<ara[i][j];
- else cout<<ara[i][j]<<" ";
- }
- cout<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement