8
1
2016
0

[BZOJ4063] [Cerc2012]Darts

模拟即可

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;

int Dist2(int x,int y){
return x*x+y*y;
}

int test,n;

int main(){
freopen("4063.in","r",stdin);
freopen("4063.out","w",stdout);
scanf("%d",&test);
while(test--){
	long long ans=0;
	scanf("%d",&n);
    for(int i=1;i<=n;i++){
		int x,y;
        scanf("%d %d",&x,&y);
        int t=Dist2(x,y);
		if(t<=20*20){ans+=10;}
		else if(t<=40*40){ans+=9;}
		else if(t<=60*60){ans+=8;}
		else if(t<=80*80){ans+=7;}
		else if(t<=100*100){ans+=6;}
		else if(t<=120*120){ans+=5;}
		else if(t<=140*140){ans+=4;}
		else if(t<=160*160){ans+=3;}
        else if(t<=180*180){ans+=2;}
        else if(t<=200*200){ans+=1;}
    }
    printf("%lld\n",ans);
}
return 0;
}
Category: BZOJ | Tags: OI bzoj | Read Count: 533

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com