Search found 3 matches

by vice
Sun Nov 06, 2005 10:18 am
Forum: Volume 100 (10000-10099)
Topic: 10038 - Jolly Jumpers
Replies: 445
Views: 152776

Finally i found my mistake and got AC

/*
ACM uva 10038 - JollyJumper
Note: !!!!Don't forget to initialize array to 0
*/

#include <stdio.h>
#include <stdlib.h>

void Jolly(int size)
{
int i = 0;
int val = 0;
int val2 = 0;
int counter = 0;
int isJolly = 1;
int diff[size];
scanf(" %d",&val);
for (i = 0;i<size ;i++ )
diff = 0 ...
by vice
Sun Nov 06, 2005 10:02 am
Forum: Volume 100 (10000-10099)
Topic: 10038 - Jolly Jumpers
Replies: 445
Views: 152776

10038 why WA?

Why my code give wa? I have tried lots of sample input but it's still wa

/* ACM uva 10038 - JollyJumper */

#include <stdio.h>
#include <stdlib.h>

void Jolly(int size)
{
int i = 0;
int val = 0;
int val2 = 0;
int counter = 0;
int isJolly = 1;
int diff[size];
scanf(" %d",&val);
while ...
by vice
Sat Sep 17, 2005 3:19 pm
Forum: Volume 5 (500-599)
Topic: 583 - Prime Factors
Replies: 171
Views: 61275

583 tle problem

I always got tle when i submit my code, anyone know better algorithm to solve this problem?



#include <stdio.h>
#include <math.h>
int isPrime(int num)
{
int j;
for (j = 2 ;j<num ;j++ )
{
if (num%j == 0)
return 0;
if (j>sqrt(num))
{
return 1;
}
}
return 0;
}

void primeFact(int x ...

Go to advanced search