Skip to content

Commit 190cd59

Browse files
committed
Added 595A - Vitaly and Night.cpp
1 parent dc67439 commit 190cd59

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

595A - Vitaly and Night.cpp

+28
Original file line numberDiff line numberDiff line change
@@ -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+
for(int i=0;i<n;i++)
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

Comments
 (0)