The time limit is now changed to 10s.
How can I make that??
In my mind, I have to use 2 loops, one for the x, and one for finding the root. If we can find the root, then y and z can be found.
However, the speed is extremely slow if N is 100000, since there are N*N iterations.
Please help...
Search found 4 matches
- Mon Oct 07, 2002 3:21 am
- Forum: Volume 1 (100-199)
- Topic: 106 - Fermat vs. Pythagoras
- Replies: 138
- Views: 30909
- Sun Oct 06, 2002 7:13 pm
- Forum: Volume 1 (100-199)
- Topic: 106 - Fermat vs. Pythagoras
- Replies: 138
- Views: 30909
faster?
Hi tatter:
I think i understand how you can the root...
but in term of speed, this is still slower.
how can i make it within 10s??
thanks
I think i understand how you can the root...
but in term of speed, this is still slower.
how can i make it within 10s??
thanks
- Sun Oct 06, 2002 2:28 am
- Forum: Volume 1 (100-199)
- Topic: 106 - Fermat vs. Pythagoras
- Replies: 138
- Views: 30909
Can you please explain?
Hi tatter:
Can you please explain how your code works??
Thanks
Can you please explain how your code works??
Thanks

- Fri Sep 27, 2002 8:15 pm
- Forum: Volume 1 (100-199)
- Topic: 108 - Maximum Sum
- Replies: 233
- Views: 52448
prob 108 - WA
I always got the wrong answer...
why??
[c]
#include <stdio.h>
void main()
{
int size;
int sum;
int max;
int A[101][101];
int B[101][101];
while(scanf("%d\n", &size) == 1)
{
sum = 0;
for(int i = 0; i <= 100; i++)
{
for(int j = 0; j <= 100; j++)
{
A [j] = 0;
B [j] = 0;
}
}
if(size ...
why??
[c]
#include <stdio.h>
void main()
{
int size;
int sum;
int max;
int A[101][101];
int B[101][101];
while(scanf("%d\n", &size) == 1)
{
sum = 0;
for(int i = 0; i <= 100; i++)
{
for(int j = 0; j <= 100; j++)
{
A [j] = 0;
B [j] = 0;
}
}
if(size ...