QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#333444#2880. Letters Q and FayazashyAC ✓3ms4048kbC++23952b2024-02-19 22:15:302024-02-19 22:15:32

Judging History

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

  • [2024-02-19 22:15:32]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:4048kb
  • [2024-02-19 22:15:30]
  • 提交

answer

#include<bits/stdc++.h>
#define endl "\n"
#define start cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
using namespace std;
int n,m,k,ac,ac2;
signed main()
{
//    start
    cin>>n>>m;
    int a[310][310]={};
    for(int i=0; i<n; i++)
    {
        cin.ignore();
        for(int j=0; j<m;j++)
            a[i][j]=(cin.get()=='#');
    }
    for(int j=m-1; j>=0; j--)
    {
        for(int i=0; i<n;i++)
        {
            if(a[i][j]&a[i][j+1]&a[i][j+2]&a[i+1][j]&a[i+2][j]&a[i+2][j+1]&a[i+2][j+2]&a[i+3][j+2]&a[i+4][j+2]&a[i+1][j+2])
                ac++,a[i][j]=a[i][j+1]=a[i][j+2]=a[i+1][j]=a[i+2][j]=a[i+2][j+1]=a[i+2][j+2]=a[i+3][j+2]=a[i+4][j+2]=a[i+1][j+2]=0;
            else if(a[i][j]&a[i][j+1]&a[i][j+2]&a[i+1][j]&a[i+2][j]&a[i+2][j+1]&a[i+3][j]&a[i+4][j])
                ac2++,a[i][j]=a[i][j+1]=a[i][j+2]=a[i+1][j]=a[i+2][j]=a[i+2][j+1]=a[i+3][j]=a[i+4][j]=0;
        }
    }
    cout<<ac<<' '<<ac2;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3964kb

input:

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

output:

1 0

result:

ok single line: '1 0'

Test #2:

score: 0
Accepted
time: 1ms
memory: 3992kb

input:

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

output:

0 1

result:

ok single line: '0 1'

Test #3:

score: 0
Accepted
time: 1ms
memory: 3928kb

input:

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

output:

1 1

result:

ok single line: '1 1'

Test #4:

score: 0
Accepted
time: 1ms
memory: 4036kb

input:

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

output:

2 2

result:

ok single line: '2 2'

Test #5:

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

input:

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

output:

1 4

result:

ok single line: '1 4'

Test #6:

score: 0
Accepted
time: 1ms
memory: 4032kb

input:

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

output:

66 70

result:

ok single line: '66 70'

Test #7:

score: 0
Accepted
time: 1ms
memory: 3900kb

input:

100 100
....###..###........######..###..###..........###....................................###...###......
.####....#.#..#######.##.####.#..#.#....###...#....###........###...###..###..###.####.....#.####...
.#..##...###..#.##..######.####..###.####.....######..........#..####....#.####...#..##.##...

output:

280 298

result:

ok single line: '280 298'

Test #8:

score: 0
Accepted
time: 3ms
memory: 3944kb

input:

300 300
...............###.###....###..###....######........###...###..###..###....###..........###..######......###....#########...............###.............###.###..###.###.........###.........###..........###....###.######.......###......###.....###...................###..###.......###............

output:

2472 2694

result:

ok single line: '2472 2694'

Test #9:

score: 0
Accepted
time: 1ms
memory: 3976kb

input:

5 298
.############.######..#########.######.###.######.######.######.##################.############.###..###..###..###.###.#####################.###..#########..###..###.###.######..###..###..###.######.###..###..######..###.###.###.######.###.###..######..#########.#########.######.###..###.#####...

output:

41 39

result:

ok single line: '41 39'

Test #10:

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

input:

299 3
###
#..
##.
#..
#..
...
...
###
#.#
###
..#
..#
...
...
...
###
#.#
###
..#
..#
...
###
#.#
###
..#
..#
###
#.#
###
..#
..#
...
###
#..
##.
#..
#..
...
...
...
###
#..
##.
#..
#..
###
#.#
###
..#
..#
...
...
###
#..
##.
#..
#..
...
...
###
#.#
###
..#
..#
###
#.#
###
..#
..#
###
#..
##.
#..
#....

output:

26 20

result:

ok single line: '26 20'

Test #11:

score: 0
Accepted
time: 1ms
memory: 3928kb

input:

123 234
.........###....###.###....###....###....###....###.....###.......######...........###..............###.###....###.......###...###......###........###............................###........###.......###....###...###..###..###.........
###..###.#...####.#.#.#....#.#.####.####.#.#....#..###..#...

output:

785 838

result:

ok single line: '785 838'

Test #12:

score: 0
Accepted
time: 1ms
memory: 3972kb

input:

234 123
.###........###.###...........###..######.............###....###...######..######................................###.......
.#.#........#.#.#.#.###..###..#....#..#.#.............#.####.#.#...#..#.#..#..#.........###..............###.###.#.#######.
.###........###.###.#.####.#####...##.###......

output:

805 836

result:

ok single line: '805 836'

Test #13:

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

input:

5 3
...
...
...
...
...

output:

0 0

result:

ok single line: '0 0'

Test #14:

score: 0
Accepted
time: 3ms
memory: 3964kb

input:

300 300
.......................................................................................................................................................................................................................................................................................................

output:

0 0

result:

ok single line: '0 0'

Test #15:

score: 0
Accepted
time: 3ms
memory: 3976kb

input:

300 300
###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###......

output:

8019 0

result:

ok single line: '8019 0'

Test #16:

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

input:

300 300
###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###......

output:

0 8019

result:

ok single line: '0 8019'