Search found 8 matches

by kauedg
Sat Aug 25, 2007 7:58 am
Forum: Volume 100 (10000-10099)
Topic: 10071 - Back to High School Physics
Replies: 49
Views: 8500

removed. =) sorry
by kauedg
Fri Aug 24, 2007 8:06 pm
Forum: Volume 100 (10000-10099)
Topic: 10071 - Back to High School Physics
Replies: 49
Views: 8500

I have just changed this line and got AC. Now im getting how the judge wants the inputs. thanks =)
by kauedg
Fri Aug 24, 2007 7:12 pm
Forum: Volume 1 (100-199)
Topic: 133 - The Dole Queue
Replies: 42
Views: 6432

I got it, had to remove the last printf("");

Your C program has solved Ok the problem 133 (The Dole Queue) in 0.000 seconds with low memory spent.
Congratulations!


Hope this help somebody.
by kauedg
Fri Aug 24, 2007 7:09 pm
Forum: Volume 1 (100-199)
Topic: 133 - The Dole Queue
Replies: 42
Views: 6432

#include <stdio.h> typedef struct QUEUE { int number; struct QUEUE *next; struct QUEUE *prev; }QUEUE; QUEUE* CreateQueue(QUEUE *q, int n) { QUEUE *temp, *last; int i; last = q; for(i=n; i>=1; i--) { temp = malloc(sizeof(QUEUE)); temp->number = i; if(q == NULL) { temp->next = temp; temp->prev = temp...
by kauedg
Fri Aug 24, 2007 6:52 pm
Forum: Volume 100 (10000-10099)
Topic: 10071 - Back to High School Physics
Replies: 49
Views: 8500

Im feeling stupid cause i cant find the answer. Help please?

Code: Select all


Code removal requested =)

by kauedg
Fri Aug 24, 2007 6:45 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 203869

made

Code: Select all

while(scanf("%d",&i) == 1 )
and worked! thanks! =D

Your C program has solved Ok the problem 100 (The 3n + 1 problem) in 4.172 seconds using as much as 392 kbytes of virtual memory.
Congratulations!
by kauedg
Fri Aug 24, 2007 5:55 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 203869

I know its a easy problem but i cant get less than 10 secons of run time. Could somebody help me please? #include <stdio.h> int Cycles(long n) { long cycles; cycles = 1; if(n <= 0) return 0; while(n!=1) { if(n%2 != 0) n = (3*n)+1; else n /= 2; cycles++; } return cycles; } int main() { unsigned int i...
by kauedg
Fri Aug 24, 2007 2:46 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 203869

100 TL

I know its a easy problem but i cant get less than 10 secons of run time. Could somebody help me please? #include <stdio.h> int Cycles(long n) { long cycles; cycles = 1; if(n <= 0) return 0; while(n!=1) { if(n%2 != 0) n = (3*n)+1; else n /= 2; cycles++; } return cycles; } int main() { unsigned int i...

Go to advanced search