We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc67439 commit 190cd59Copy full SHA for 190cd59
595A - Vitaly and Night.cpp
@@ -0,0 +1,28 @@
1
+#include<bits/stdc++.h>
2
+using namespace std;
3
+
4
+// Code Written By: Vikash Patel
5
6
+int main()
7
+{
8
+ int n,m;
9
+ cin>>n>>m;
10
+ int lights[n][2*m];
11
+ for(int i=0;i<n;i++)
12
+ {
13
+ for(int j=0;j<2*m;j++)
14
15
+ cin>>lights[i][j]; // n String can also be taken as input
16
+ }
17
18
+ int ans=0;
19
20
21
+ for(int j=0;j<2*m;j+=2)
22
23
+ if(lights[i][j]==1 || lights[i][j+1]==1)
24
+ ans++;
25
26
27
+ cout<<ans<<endl;
28
+}
0 commit comments