90672024-02-13 16:56:48L3ONCsúcsokcpp17Wrong answer 0/100178ms523524 KiB
#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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1748 KiB
2Wrong answer3ms1992 KiB
subtask20/16
3Wrong answer68ms5088 KiB
4Wrong answer59ms5300 KiB
5Wrong answer56ms5440 KiB
6Wrong answer71ms5744 KiB
7Wrong answer68ms5964 KiB
8Wrong answer65ms6072 KiB
subtask30/33
9Wrong answer140ms10972 KiB
10Wrong answer138ms10916 KiB
11Wrong answer128ms10312 KiB
12Wrong answer3ms3060 KiB
13Wrong answer4ms3184 KiB
14Wrong answer4ms3324 KiB
15Wrong answer140ms11276 KiB
subtask40/51
16Runtime error164ms523524 KiB
17Runtime error162ms523504 KiB
18Runtime error159ms523476 KiB
19Wrong answer178ms7576 KiB
20Wrong answer81ms7660 KiB
21Runtime error164ms523180 KiB
22Runtime error165ms522984 KiB
23Runtime error163ms522928 KiB
24Runtime error163ms522924 KiB