Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main() {
- int size;
- cin>>size;
- int matrix[size][size];
- for (int x = 0; x < size; x++)
- for (int y = 0; y < size; y++) {
- cin>>matrix[x][y];
- }
- vector<int> ist, st;
- int g = 0;
- int j = 0;
- for (int x = 0; x < size; x++) {
- for (int y = 0; y < size; y++) {
- if (matrix[x][y]) {
- g++;
- }
- }
- for (int u = 0; u < size; u++) {
- if (matrix[u][x]) {
- j++;
- }
- }
- if (g == 0) {
- st.push_back(x+1);
- }
- if (j == 0) {
- ist.push_back(x+1);
- }
- g=0;
- j=0;
- }
- cout<<ist.size()<<endl;
- for (int x = 0; x < ist.size(); x++) {
- cout<<ist[x]<<endl;
- }
- cout<<st.size()<<endl;
- for (int x = 0; x < st.size(); x++) {
- cout<<st[x]<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement