QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#671735#2880. Letters Q and FFolity#WA 0ms3636kbC++201.1kb2024-10-24 14:15:032024-10-24 14:15:05

Judging History

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

  • [2024-10-24 14:15:05]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3636kb
  • [2024-10-24 14:15:03]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

const int N=305;
const pii F[8]={{0,0},{0,1},{0,2},{1,0},{2,0},{2,1},{3,0},{4,0}};
const pii Q[10]={{0,0},{0,1},{0,2},{1,0},{1,2},{2,0},{2,1},{2,2},{3,2},{4,2}};
int n,m;
string a[N];
bool chk(int i,int j){
    return i>=0&&i<n&&j>=0&&j<m&&a[i][j]=='#';
}

int main(){
    cin>>n>>m;
    for(int i=0;i<n;++i)cin>>a[i];
    int ans1=0,ans2=0;
    for(int i=0;i<n;++i)
        for(int j=0;j<m;++j)if(a[i][j]=='#'){
            bool fl=1;
            for(int k=0;k<8;++k)if(!chk(i+F[k].first,j+F[k].second))fl=0;
            if(fl){
                for(int k=0;k<8;++k)a[i+F[k].first][j+F[k].second]='.';
                ++ans1;
            }
            else{
                fl=1;
                for(int k=0;k<10;++k)if(!chk(i+Q[k].first,j+Q[k].second))fl=0;
                if(fl){
                    for(int k=0;k<10;++k)a[i+Q[k].first][j+Q[k].second]='.';
                    ++ans2;
                }
            }
        }
    cout<<ans1<<' '<<ans2<<'\n';
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3636kb

input:

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

output:

0 1

result:

wrong answer 1st lines differ - expected: '1 0', found: '0 1'