Skip to content

Commit 517b7f8

Browse files
committed
Create 1701A-GrassField.cpp
1 parent 1d83654 commit 517b7f8

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

1701A-GrassField.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include <cstdio>
2+
3+
int main(){
4+
5+
long t; scanf("%ld", &t);
6+
while(t--){
7+
long cnt(0);
8+
for(int row = 0; row < 2; row++){
9+
for(int col = 0; col < 2; col++){
10+
long x; scanf("%ld", &x);
11+
cnt += x;
12+
}
13+
}
14+
15+
long res(0);
16+
if(cnt == 4){res = 2;}
17+
else if(cnt > 0){res = 1;}
18+
19+
printf("%ld\n", res);
20+
}
21+
22+
}

0 commit comments

Comments
 (0)