Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- const int N = 10e3;
- vector<int> adj[N];
- int main() {
- int V;
- cin>>V;
- for(int i=0;i<V;i++) {
- for(int j=0;j<V;j++) {
- int x;
- cin>>x;
- if(x==1) {
- adj[i].push_back(j);
- }
- }
- }
- vector<int> list;
- for(int i=0;i<V;i++) {
- if(adj[i].size()%2!=0) { list.push_back(i);}
- }
- if(list.empty()) {
- cout<<-1<<endl;
- } else {
- for(auto x:list) { cout<<x<<endl; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement