北京师范大学珠海分校
Judge Online of ACM ICPC
1326 乒乓游戏
C语言版
Judge Online of ACM ICPC
1326 乒乓游戏
C语言版
- #include <stdio.h>
- int calc(int x,int y){
- if((x-30)*(x-30)+(y-30)*(y-30)<400) return 1;
- else if ((x-100)*(x-100)+(y-30)*(y-30)<100) return 2;
- else if ((x-170)*(x-170)+(y-30)*(y-30)<25) return 3;
- else return 0;
- }
- int main(){
- int t,n,x,y,score;
- scanf("%d",&t);
- while(t--){
- score=0;
- scanf("%d",&n);
- while(n--){
- scanf("%d%d",&x,&y);
- score+=calc(x,y);
- }
- printf("%d/n",score);
- }
- return 0;
- }