Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

枚举。。。晕啊

Posted by ZHG177 at 2017-04-26 01:24:49 on Problem 3175
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator