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