http://online-judge.uva.es/board/viewto ... ight=10606windows2k wrote:Hello, I have passed the problem before rejudge.
But I got TLE all the time.
Could someone offer an proper algorithm to solve the problem?
Thx
10023 - Square root
Moderator: Board moderators
My signature:
- Please make discussion about the algorithm BRFORE posting source code.
We can learn much more in discussion than reading source code. - I HATE testing account.
- Don't send me source code for debug.
-
- Learning poster
- Posts: 77
- Joined: Fri Dec 17, 2004 11:06 am
- Location: East West University, Dhaka, Bangladesh
- Contact:
After re-judging, this function has become a 'baby' one. Now the real challenge is waiting for every one. 

Please join The ACM Solver Group at Yahoo
http://groups.yahoo.com/group/acm_solver/
http://groups.yahoo.com/group/acm_solver/
-
- Experienced poster
- Posts: 136
- Joined: Fri Apr 15, 2005 3:47 pm
- Location: Singapore
- Contact:
10023 Why WA ????
Hi,I have a problem in 10023,I always got WA,anyone could help ???
#include <stdio.h>
#include<math.h>
void main()
{
int a,i;
long double y;
scanf("%d",&a);
for(i=0;i<a;i++)
{
scanf("%Lf",&y);
printf("%.0Lf\n",sqrtl(y));
printf("\n");
}
}
#include <stdio.h>
#include<math.h>
void main()
{
int a,i;
long double y;
scanf("%d",&a);
for(i=0;i<a;i++)
{
scanf("%Lf",&y);
printf("%.0Lf\n",sqrtl(y));
printf("\n");
}
}
10023 - Square Root
The number can be 1000 digits long. So you just can't do it so simple. You could have done it if the number was at most 15-16 digit I guess. You need to use bigint to solve this problem.
Regards
Sanny
Regards
Sanny
-
- Experienced poster
- Posts: 209
- Joined: Sun Jan 16, 2005 6:22 pm
10023
Hey that's my code.I've got WR.But can't understand why?Plz help me to understand.
#include<stdio.h>
#include<math.h>
void main()
{
long double y;
int x;
scanf("%d",&x);
while(x--)
{
printf("\n");
scanf("%Lf",&y);
printf("%.0Lf\n",sqrtl(y));
}
}
#include<stdio.h>
#include<math.h>
void main()
{
long double y;
int x;
scanf("%d",&x);
while(x--)
{
printf("\n");
scanf("%Lf",&y);
printf("%.0Lf\n",sqrtl(y));
}
}
10023
I tried a lot, but still i m in TLE! 
I send only a input taking code and i run upto 0.010s! so i think input file is very big.
My best timing is 11.9 s for 100 maximum lenth input in my 600MHz pc, and I think i cann't do more then this
I want to request the judge to reduce it's input so that more people can solve it in different method, (not only in the way that the problem setter have
)
if any one wants to help me plz send me a PM

I send only a input taking code and i run upto 0.010s! so i think input file is very big.
My best timing is 11.9 s for 100 maximum lenth input in my 600MHz pc, and I think i cann't do more then this

I want to request the judge to reduce it's input so that more people can solve it in different method, (not only in the way that the problem setter have

if any one wants to help me plz send me a PM
10023
Please someone check Why WA?
Code: Select all
/*
Name: Squre root
Number: 10023
Type : math
Process : ON
Author :Salman Zaman
Email : zamansalman@gmail.com
Date : 24/08/05 23:31
*/
#include<stdio.h>
#include<math.h>
//#include<conio.h>
int main(){
long double y;
long n;
// freopen("10023.txt","r",stdin);
scanf("%ld",&n);
for(;n;n--){
scanf("%lf",&y);
printf("%.0lf\n\n",sqrtl(y));
}
// getch();
return 0;
}