QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#453626#2880. Letters Q and Fem4ma2WA 1ms3668kbC++141.6kb2024-06-24 02:48:582024-06-24 02:48:59

Judging History

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

  • [2024-06-24 02:48:59]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3668kb
  • [2024-06-24 02:48:58]
  • 提交

answer

//                          بسم الله الرحمن الرحيم
#include "bits/stdc++.h"

using namespace std;

#define ll long long
#define int long long
#define pb push_back
#define pob pop_back
//#define pb push
#define endl '\n'
#define ld long double
/*
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops,avx,avx2,ssse3,tune-native")
*/
#define applejuice ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);

const ll mod=1e9+7;
const ll inf=1e18;
const ll mxsz=104;
const double pi=acos(-1.0);

char a[mxsz][mxsz];

void res(int i,int j,char c){
    if (c=='f'){
        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]='.';
    }else{
        a[i][j]='.';
        a[i][j+1]='.';
        a[i][j+2]='.';
        a[i+1][j]='.';
        a[i+1][j+2]='.';
        a[i+2][j]='.';
        a[i+2][j+1]='.';
        a[i+2][j+2]='.';
        a[i+3][j+2]='.';
        a[i+4][j+2]='.';
    }
}

signed main(){
    applejuice;

    int n,m;
    cin>>n>>m;
    for (int i=0;i<n;i++){
        for (int j=0;j<m;j++){
            cin>>a[i][j];
        }
    }
    int ansq=0,ansf=0;
    for (int i=0;i<n-4;i++){
        for(int j=0;j<m-2;j++){
            if (a[i][j]=='#'){
                if(a[i+4][j]=='#'){
                    res(i,j,'f');
                    ansf++;
                }else{
                    res(i,j,'q');
                    ansq++;
                }
            }
        }
    }
    cout<<ansq<<" "<<ansf<<endl;

    return 0;
}

詳細信息

Test #1:

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

input:

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

output:

1 0

result:

ok single line: '1 0'

Test #2:

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

input:

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

output:

0 1

result:

ok single line: '0 1'

Test #3:

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

input:

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

output:

1 1

result:

ok single line: '1 1'

Test #4:

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

input:

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

output:

2 2

result:

ok single line: '2 2'

Test #5:

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

input:

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

output:

1 4

result:

ok single line: '1 4'

Test #6:

score: -100
Wrong Answer
time: 1ms
memory: 3656kb

input:

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

output:

88 94

result:

wrong answer 1st lines differ - expected: '66 70', found: '88 94'