Easy Contest 5 (E)

All contest related discussion goes here. Both Dev Skill and Non Dev Skill contest related discussion is allowed. (But please keep the forum clean)

Easy Contest 5 (E)

by codeFreak » Fri Oct 07, 2016 11:43 pm

got wrong ans in E...can anybody help me?
here is my code

Code: Select all
#include<iostream>
#include<cmath>

using namespace std;

int main()
{
    int t;
    cin>>t;
    for(int i=1;i<=t;i++){
        long double n;
        cin>>n;

        long double mini=999999999999;
        cout<<mini<<endl;
        for(double m=1;m<=(int)sqrt(n);m++){
            if((((int)(n/m))*m)==n){
                if(abs(m-(n/m))<mini){
                    mini=abs(m-(n/m));
                }
            }
        }
        cout<<mini<<endl;
    }
    return 0;
}
 
Posts: 1
Joined: Fri Oct 07, 2016 11:41 pm

Re: Easy Contest 5 (E)

by devskill » Mon Oct 17, 2016 12:41 pm

Looks like you got it Accepted already. Congratulation!
User avatar
Site Admin
 
Posts: 118
Joined: Tue Feb 02, 2016 10:24 pm


Who is online
Users browsing this forum: Bing [Bot] and 1 guest
cron