QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#274903#2880. Letters Q and FthealekbarliWA 0ms3700kbC++17887b2023-12-04 05:04:242023-12-04 05:04:26

Judging History

你现在查看的是最新测评结果

  • [2023-12-04 05:04:26]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3700kb
  • [2023-12-04 05:04:24]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n,m;
    cin>>n>>m;
    char arr[n][m];
    int f =0,q=0;
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<m; j++)
        {
            cin>>arr[i][j];
        }
    }
    for(int i=0; i<n-4; i++)
    {
        for(int j=0; j<m-2; j++)
        {
            if(arr[i][j]=='#' && arr[i][j+1]=='#' && arr[i][j+2]=='#' && arr[i+1][j]=='#' && arr[i+2][j]=='#' && arr[i+2][j+1]=='#' && arr[i+3][j]=='#' && arr[i+4][j]=='#')
            {
                f++;
            }
            else if(arr[i][j]=='#' && arr[i][j+1]=='#' && arr[i][j+2]=='#' && arr[i+1][j]=='#' && arr[i+1][j+2]=='#' && arr[i+2][j]=='#' && arr[i+2][j+1]=='#' && arr[i+2][j+2]=='#' && arr[i+3][j+2]=='#' &&arr[i+4][j+2]=='#')
            {
                q++;
            }
        }
    }
    cout<<q<<" "<<f;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3576kb

input:

5 3
###
#.#
###
..#
..#

output:

1 0

result:

ok single line: '1 0'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3696kb

input:

5 3
###
#..
##.
#..
#..

output:

0 1

result:

ok single line: '0 1'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3640kb

input:

5 8
###..###
#.#..#..
###..##.
..#..#..
..#..#..

output:

1 1

result:

ok single line: '1 1'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3636kb

input:

8 8
.....###
###..#.#
#.######
###.####
#.###.##
#.#.###.
..#...#.
......#.

output:

2 2

result:

ok single line: '2 2'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

10 10
....###...
....#.###.
....###...
....#.##..
###.#.####
#.###.##..
###.#..##.
#.###..#..
#...#..#..
....#.....

output:

1 4

result:

ok single line: '1 4'

Test #6:

score: -100
Wrong Answer
time: 0ms
memory: 3700kb

input:

50 50
###..................###.......###...###.......###
#.....###.........####..###....#.....#.####.####.#
#####.#...######..#.###.#.###..##....####...#..###
#.#...##..#.##....####..###....#.......###..##...#
#.##..#...#####.###.##..#.##...#.###...##...#....#
..#####.###.##..#.#.#...#.#......#.####...

output:

64 89

result:

wrong answer 1st lines differ - expected: '66 70', found: '64 89'