#include <iostream>
using namespace std;
void kiirmat(int s, int o, int *m)
{
for(int i=0;i<s;i++)
{
for(int j=0;j<o;j++)
cout<<m[i*s+j]<<"\t";
cout<<endl;
}
return;
}
int main()
{
int n, m;
cin>>n>>m;
int a[n], b[m];
int mat[n+2][m+2]={0};
for(int i=0;i<n+2;i++)
for(int j=0;j<m+2;j++)
mat[i][j]=0;
for(int i=0;i<n;i++)
cin>>a[i];
for(int i=0;i<m;i++)
cin>>b[i];
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
mat[i][j]=a[i-1]*b[j-1];
}
for(int i=0;i<n+2;i++)
{
for(int j=0;j<m+2;j++)
cout<<mat[i][j]<<"\t";
cout<<endl;
}
int csucssz=0;
for(int i=1;i<n+1;i++)
for(int j=1;j<m+1;j++)
{
if(mat[i][j]>mat[i-1][j] && mat[i][j]>mat[i+1][j] && mat[i][j]>mat[i][j-1] && mat[i][j]>mat[i][j+1])
csucssz++;
}
cout<<csucssz;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 3ms | 1748 KiB | ||||
2 | Wrong answer | 3ms | 1992 KiB | ||||
subtask2 | 0/16 | ||||||
3 | Wrong answer | 68ms | 5088 KiB | ||||
4 | Wrong answer | 59ms | 5300 KiB | ||||
5 | Wrong answer | 56ms | 5440 KiB | ||||
6 | Wrong answer | 71ms | 5744 KiB | ||||
7 | Wrong answer | 68ms | 5964 KiB | ||||
8 | Wrong answer | 65ms | 6072 KiB | ||||
subtask3 | 0/33 | ||||||
9 | Wrong answer | 140ms | 10972 KiB | ||||
10 | Wrong answer | 138ms | 10916 KiB | ||||
11 | Wrong answer | 128ms | 10312 KiB | ||||
12 | Wrong answer | 3ms | 3060 KiB | ||||
13 | Wrong answer | 4ms | 3184 KiB | ||||
14 | Wrong answer | 4ms | 3324 KiB | ||||
15 | Wrong answer | 140ms | 11276 KiB | ||||
subtask4 | 0/51 | ||||||
16 | Runtime error | 164ms | 523524 KiB | ||||
17 | Runtime error | 162ms | 523504 KiB | ||||
18 | Runtime error | 159ms | 523476 KiB | ||||
19 | Wrong answer | 178ms | 7576 KiB | ||||
20 | Wrong answer | 81ms | 7660 KiB | ||||
21 | Runtime error | 164ms | 523180 KiB | ||||
22 | Runtime error | 165ms | 522984 KiB | ||||
23 | Runtime error | 163ms | 522928 KiB | ||||
24 | Runtime error | 163ms | 522924 KiB |