Search found 22 matches

by rafastv
Mon Jun 26, 2017 6:12 pm
Forum: Volume 1 (100-199)
Topic: 127 - "Accordian" Patience
Replies: 83
Views: 9226

Re: 127 - "Accordian" Patience

It took me more time than needed, just remember as a tip that you must move only ONE card from the piles in a movement. I don't know why I thought you needed to move the whole pile (but sometimes you do).
by rafastv
Sat Jun 24, 2017 8:42 am
Forum: Volume 1 (100-199)
Topic: 126 - The Errant Physicist
Replies: 25
Views: 3588

Re: 126 - The Errant Physicist

Just so somebody else knows, my code do not print zeros (as the problem states and got AC'd). And my solution got AC when I increased the numbers' range that my code is able to handle, regardless of what the problem says.
by rafastv
Wed Jun 14, 2017 3:49 pm
Forum: Volume 1 (100-199)
Topic: 115 - Climbing Trees
Replies: 30
Views: 11228

Re: 115 - Climbing Trees

If you read until this far and is still having trouble, some tips for you:

1) It is not a single tree, but a forest.

2) Not every line has a pair of names.

3) Do consider some cases: a.a a.a, a.a no.parent, and no.child a.a

I just got AC, but this problem gave me some minor headaches.

Good luck!
by rafastv
Thu Jul 26, 2007 8:10 pm
Forum: Volume 1 (100-199)
Topic: 105 - The Skyline Problem
Replies: 160
Views: 27538

I keep getting WA..

It works for all test cases here...I even tested for L>R and ignored when L=R. The Code works fine...it organizes the builings by its right and left coordenates..and after it, try to draw a line through its height(it saves the heights at a stack of ordered heights) ... #include <stdio.h> #include <s...
by rafastv
Tue Jun 19, 2007 5:27 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 181816

Thanks changed the code to long int and solved it 8) Just for curiosity, well the choice I made for float types is because they do carry a more representative type than integers at least when I looked at floats.h FLT_MAX=340282346638528859811704183484516925440.000000 while max integers are short unl...
by rafastv
Tue Jun 19, 2007 4:45 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 181816

Changed the code, read the thread but still got WA, no longer TLE though :( #include <stdio.h> #include <math.h> float vetor[1000000]; float max_ciclos(float); int main(int argc,char **argv){ unsigned long int i,j,k,a,b; float c,aux; for (k=0;k<1000000;k++) vetor[k]=0.0; while((scanf("%lu %lu",&i,&j...
by rafastv
Tue Jun 19, 2007 3:23 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 181816

I'm getting Time Limit Exceeded always :( can somebody tell me what am I doing wrong? #include <stdio.h> #include <math.h> float max_ciclos(float); int main(int argc,char **argv){ unsigned long int i,j,k,a,b; float c,aux; float vetor[1000000]; for (k=1;k<1000000;k++) vetor[k]=max_ciclos((float)k); w...

Go to advanced search