ID | Submission ID | Problem | Hacker | Owner | Result | Submit time | Judge time |
---|---|---|---|---|---|---|---|
#137 | #197795 | #3433. Crisscross | Goneend | 18112606231 | Failed. | 2023-11-14 17:20:49 | 2023-11-14 17:20:49 |
Details
Extra Test:
Accepted
time: 0ms
memory: 1204kb
input:
5 5 01111 10001 10001 10001 11111
output:
8
result:
ok 1 number(s): "8"
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#197795 | #3433. Crisscross | 18112606231 | 97 | 335ms | 2172kb | C++ | 689b | 2023-11-14 15:16:02 | 2023-11-14 17:29:20 |
answer
#include <bits/stdc++.h>
#define int long long
using namespace std;
int n,m,x,sum[1001][1001],cnt,ans;
char a[1001][1001];
signed main()
{
scanf("%lld %lld",&n,&m);
for(int i=1;i<=n;i++)
{
cnt=0;
scanf("\n");
for(int j=1;j<=m;j++)
{
scanf("%c",&a[i][j]);
if(a[i][j]=='0')
cnt++;
}
if(cnt&&cnt!=1)
ans++;
}
for(int i=1;i<=m;i++)
{
cnt=0;
for(int j=1;j<=n;j++)
{
if(a[j][i]=='0')
cnt++;
}
if(cnt)
ans++;
}
printf("%lld",ans+1);
return 0;
}