| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
枚举。。。晕啊#include<cstdio>
#include<math.h>
#include <iostream>
#define eps 1e-8
using namespace std;
double a[11]={1,1e-1,1e-2,1e-3,1e-4,1e-5,1e-6,1e-7,1e-8,1e-9,1e-10};
int main(){
int n;
int m;
double p,q,x,y;
while(scanf("%d",&n)!=EOF){
scanf("%d",&m);
p=m*a[n]; q=(m+1)*a[n];
x=y=0;
while(x==y){
p+=1; q+=1;
x=floor(p*p); y=floor(q*q-eps);
}
printf("%.f\n",floor(y));
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator