记录编号 40694 评测结果 AAAAAAAAAA
题目名称 [暑假培训2012] 打乒乓球 最终得分 100
用户昵称 Gravatar日光。 是否通过 通过
代码语言 C++ 运行时间 0.005 s
提交时间 2012-07-18 16:48:27 内存使用 0.31 MiB
显示代码纯文本
  1. #include<iostream>
  2. #include<fstream>
  3. #include<cmath>
  4. using namespace std;
  5. int main()
  6. {
  7. ifstream fin("table2.in");
  8. ofstream fout("table2.out");
  9. int ncase;
  10. fin>>ncase;
  11. while(ncase--)
  12. {
  13. int ans=0;
  14. int n;
  15. int x,y;
  16. int a,b,c;
  17. fin>>n;
  18. for(int i=1;i<=n;i++)
  19. {
  20. fin>>x>>y;
  21. a=(x-30)*(x-30)+(y-30)*(y-30);
  22. b=(x-100)*(x-100)+(y-30)*(y-30);
  23. c=(x-170)*(x-170)+(y-30)*(y-30);
  24. if(a<400) ans+=1;
  25. if(b<100) ans+=2;
  26. if(c<25) ans+=3;
  27. }
  28. fout<<ans<<endl;
  29. }
  30. return 0;
  31. }