Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a[101][101],n,m,i,j,C;
- void citire();
- int main()
- {
- citire();
- for(i=1;i<=n;i++)
- {
- for(j=1;j<=n;j++)
- a[i][0]+=a[i][j];
- }
- for(j=1;j<=n;j++)
- {
- for(i=1;i<=n;i++)
- a[0][j]+=a[i][j];
- }
- for(i=1;i<=n;i++)
- {
- if(a[i][0]==a[0][i])
- C++;
- }
- cout<<C<<endl;
- for(i=1;i<=n;i++)
- {
- if(a[0][i]==a[i][0])
- cout<<i<<" ";
- }
- return 0;
- }
- void citire()
- {
- int x,y;
- cin>>n>>m;
- for(i=1;i<=m;i++)
- {
- cin>>x>>y;
- a[x][y]=1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement