Search found 5 matches

by Max108
Wed Jun 18, 2003 12:27 am
Forum: Volume 103 (10300-10399)
Topic: 10394 - Twin Primes
Replies: 101
Views: 31813

Thank you!!

That was the problem, I got AC now! :P
by Max108
Tue Jun 17, 2003 12:32 am
Forum: Volume 103 (10300-10399)
Topic: 10394 - Twin Primes
Replies: 101
Views: 31813

confused

can any of you guys tellme whats wrong with my code, im getting WA [cpp] #include <fstream.h> #include <math.h> /*Returns one if the number is prime, else it returns zero*/ int isPrime(int n) { int root = sqrt(n); for(int i=3; i<root; i+=2) if(n % i == 0) return 0; return 1; } void main() { long i=0...
by Max108
Tue Jun 17, 2003 12:23 am
Forum: Volume 103 (10300-10399)
Topic: 10394 - Twin Primes
Replies: 101
Views: 31813

10394 Bad output or WA? PLZ help!

Hi, This is my code, it is very simple but it finishes calculationes within the alloted time so thats just fine for me but im getting WA and i dont know why!!!! [cpp] #include <fstream.h> #include <math.h> /*Returns one if the number is prime, else it returns zero*/ int isPrime(int n) { int root = s...
by Max108
Fri Jun 13, 2003 7:59 pm
Forum: Volume 6 (600-699)
Topic: 612 - DNA Sorting
Replies: 122
Views: 15469

612 WA help!!

Hi, i just wrote this code for the 612 DNA sorting problem, no matter what imput i select to test my program it ALWAYS gives me the CORRECT answer but when i submit the program the judge says WA. [cpp] #include <fstream.h> #include <string.h> #include <stdlib.h> struct Cadenas { int peso; int orden;...
by Max108
Wed Jun 11, 2003 11:29 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 178955

Hi

I tested the problem with the code that you gave: the only thing, the one that gives you wrong answer, is that you are not uptadating the maximum length to zero again... look try with this example. 100 200 = 125 //this is the correct answer 201 210 = 89 //same but your program keeps giving 125 when ...

Go to advanced search