We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ce3a28 commit 75b65d2Copy full SHA for 75b65d2
545A.cpp
@@ -0,0 +1,49 @@
1
+#include<bits/stdc++.h>
2
+using namespace std;
3
+
4
+int main(){
5
+ ios_base::sync_with_stdio(false);
6
+ cin.tie(NULL);
7
8
+ int n;
9
+ cin>>n;
10
11
+ int arr[n][n];
12
13
+ map<int, bool> mp;
14
15
+ for(int i = 0; i< n; i++){
16
+ for(int j = 0; j< n; j++){
17
+ cin>>arr[i][j];
18
+ }
19
20
21
+ for(int i = 0; i < n; i++){
22
+ for(int j = i+1; j < n; j++){
23
+ if(arr[i][j] == 1){
24
+ mp[i] = true;
25
+ continue;
26
27
+ if(arr[i][j] == 2){
28
+ mp[j] = true;
29
30
31
+ if(arr[i][j] == 3){
32
+ mp[i] = mp[j] = true;
33
34
35
36
37
38
+ int arrb[n], k = 0;
39
40
+ if(!mp[i]){
41
+ arrb[k] = i + 1;
42
+ k++;
43
44
45
+ cout<<k<<'\n';
46
+ for(int i = 0; i < k; i++){
47
+ cout<<arrb[i]<<" ";
48
49
+}
0 commit comments