比赛 202103省实验桐柏一中普及组联赛 评测结果 AAAAAAAAAA
题目名称 知己知彼,百战不殆 最终得分 100
用户昵称 数声风笛ovo 运行时间 0.160 s
代码语言 C++ 内存使用 14.83 MiB
提交时间 2021-03-22 19:53:02
显示代码纯文本
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;
const int maxn=2e3;
int m,n,ans1=0,maxx=-114514,ans2=1;
int mp[maxn][maxn]={0};
void fuck(int x,int y){
    mp[x][y]++;
    if(x+2<=n&&x+2>=1&&y+1<=n&&y+1>=0) mp[x+2][y+1]++;
    if(x+2<=n&&x+2>=1&&y-1<=n&&y-1>=0) mp[x+2][y-1]++;
    if(x+1<=n&&x+1>=1&&y+2<=n&&y+2>=0) mp[x+1][y+2]++;
    if(x+1<=n&&x+1>=1&&y-2<=n&&y-2>=0) mp[x+1][y-2]++;
    if(x-1<=n&&x-1>=1&&y+2<=n&&y+2>=0) mp[x-1][y+2]++;
    if(x-1<=n&&x-1>=1&&y-2<=n&&y-2>=0) mp[x-1][y-2]++;
    if(x-2<=n&&x-2>=1&&y+1<=n&&y+1>=0) mp[x-2][y+1]++;
    if(x-2<=n&&x-2>=1&&y-1<=n&&y-1>=0) mp[x-2][y-1]++;
    return ;
}
int main(){
    freopen("safenum.in","r",stdin);
    freopen("safenum.out","w",stdout);
    scanf("%d%d",&n,&m);
    for(int i=1;i<=m;i++){
        int x,y;
        scanf("%d%d",&x,&y);
        fuck(x,y);
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            if(!mp[i][j]) ans1++;
            if(mp[i][j]>maxx){
                maxx=mp[i][j];
                ans2=1;
            }
            else if(mp[i][j]==maxx) ans2++;
        }
    }
    printf("%d\n%d %d\n",ans1,maxx,ans2);
    return 0;
}