Page 3 of 9
Posted: Sat Dec 11, 2004 9:32 pm
by ..
windows2k 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

http://online-judge.uva.es/board/viewto ... ight=10606
10023
Posted: Wed Dec 15, 2004 6:59 am
by eshika
Can anybody tell me, why WA?
[c]
#include<stdio.h>
#include<math.h>
void main()
{
int n,i;
long double x,y;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%Lf",&y);
x=sqrtl(y);
printf("%.0Lf\n\n",x);
}
}
[/c]
Posted: Wed Dec 15, 2004 8:18 am
by shamim
look at the size of input, basic data types can't handle it.
Posted: Wed Dec 15, 2004 10:11 am
by eshika
Would you explain in more details?
Should I use string operations? I have read few threads in this forum regarding 727 after I got WA. Many of them get accepted using sqrtl() with long double. As I expected sqrtl() surprisingly solves the problem. Then what is wrong with my code?
Posted: Sat Dec 18, 2004 5:08 pm
by Niaz
After re-judging, this function has become a 'baby' one. Now the real challenge is waiting for every one.

10023 Why WA ????
Posted: Sun Apr 24, 2005 8:13 am
by jan_holmes
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");
}
}
10023 - Square Root
Posted: Sun Apr 24, 2005 7:44 pm
by Sanny
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
10023
Posted: Tue May 31, 2005 6:52 pm
by asif_rahman0
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));
}
}
Posted: Wed Jun 01, 2005 6:01 am
by chunyi81
Read the problem description: Biggest input is 10^1000 (that is 1000 digits)
You have to use big integer.
Posted: Wed Jun 01, 2005 9:01 am
by Rocky
Yes You Need BigInteger And You Need To Solve It With Manullay squre root.
GOOD LUCK
Rocky
10023
Posted: Wed Jul 20, 2005 2:50 pm
by A1
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
Posted: Sat Aug 06, 2005 11:08 pm
by daveon
Perhaps somewhere down along the road, you will come up with a better solution.
Problems that take you the most time to solve are the problems that you'll likely admire the most.
And how do you know if there is only one way to solve this?
Posted: Thu Aug 25, 2005 7:16 am
by A1
Have you solve this problem?
10023
Posted: Mon Aug 29, 2005 8:20 am
by Salman
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;
}
Posted: Mon Aug 29, 2005 11:33 am
by daveon
As of today, this problem still remains unsolved from my point of view.