比赛 |
20140418 |
评测结果 |
C |
题目名称 |
奶牛冰壶运动 |
最终得分 |
0 |
用户昵称 |
超级傲娇的AC酱 |
运行时间 |
0.000 s |
代码语言 |
C++ |
内存使用 |
0.00 MiB |
提交时间 |
2014-04-18 10:16:06 |
显示代码纯文本
/*
写完之后发现自己读错提了==
TT
好忧伤
*/
#include<iostream>
#include<vector>
#include<cstdio>
using namespace std;
vector<vector<bool> >Map_A,Map_B;
vector<pair<int,int> >A,B;
int Ans_A=0,Ans_B=0;
int main()
{
int i,n,x,y,X_Min=0,X_Max=0,Y_Min=0,Y_Max=0,Judge_A,Judge_B;
freopen("curling.in","r",stdin);
freopen("curling.out","w",stdout);
cin>>n;
A.resize(n);B.resize(n);
for(i=0;i<n;i++)
{
cin>>x>>y;
A.push_back(make_pair(x,y));
X_Min=min(X_Min,x);
X_Max=max(X_Max,x);
Y_Min=min(Y_Min,y);
Y_Max=max(Y_Max,y);
}
for(i=0;i<n;i++)
{
cin>>x>>y;
B.push_back(make_pair(x,y));
X_Min=min(X_Min,x);
X_Max=max(X_Max,x);
Y_Min=min(Y_Min,y);
Y_Max=max(Y_Max,y);
}
Map_A.resize(abs(X_Max-X_Min)+10);
Map_B.resize(abs(X_Max-X_Min)+10);
for(i=0;i<Map_A.size();i++)
{
Map_A[i].resize(abs(Y_Max-Y_Min)+10);
Map_B[i].resize(abs(Y_Max-Y_Min)+10);
}
for(i=0;i<n;i++)
{
A[i].first-=X_Min;
A[i].second-=Y_Min;
B[i].first-=X_Min;
B[i].second-=Y_Min;
Map_A[A[i].first][A[i].second]=true;
Map_B[B[i].first][B[i].second]=true;
}
for(i=0;i<n;i++)
{
Judge_A=
Map_B[A[i].first+1][A[i].second+1]^Map_B[A[i].first-1][A[i].second+1]^Map_B[A[i].first+1][A[i].second-1]^Map_B[A[i].first-1][A[i].second-1];
Judge_B=
Map_A[B[i].first+1][B[i].second+1]^Map_B[A[i].first-1][A[i].second+1]^Map_B[A[i].first+1][A[i].second-1]^Map_B[A[i].first-1][A[i].second-1];
if(Judge_A==true)Ans_A++;
if(Judge_B==true)Ans_B++;
}
cout<<Ans_A<<' '<<Ans_B;
return 0;
}