我的代码无无解特判甚至样例2都没过就AC了
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int n,k,x,y,heng[N],shu[N],zxy[N],yxy[N],ans,zyx[N],yyx[N];
int main(){
scanf("%d%d",&n,&k);
for(int i=1;i<=n;i++){
scanf("%d%d",&x,&y);
ans++;
heng[y]++;
shu[x]++;
if(x>=y){
zxy[x-y]++;
yxy[x+y]++;
if(zxy[x-y]==k){
cout<<ans;
return 0;
}
if(yxy[x+y]==k){
cout<<ans;
return 0;
}
}
if(x<=y){
zyx[y-x]++;
if(zyx[y-x]==k){
cout<<ans;
return 0;
}
}
if(heng[y]==k){
cout<<ans;
return 0;
}
if(shu[x]==k){
cout<<ans;
return 0;
}
}
return 0;
}