## Search found 10 matches

Thu Oct 30, 2003 6:28 pm
Forum: Volume 6 (600-699)
Topic: 694 - The Collatz Sequence
Replies: 46
Views: 16576
You know what... Practice makes a man perfect!
Mon Oct 27, 2003 9:11 pm
Forum: Volume 6 (600-699)
Topic: 694 - The Collatz Sequence
Replies: 46
Views: 16576
This one is very simple and pretty straight forward 3n+1 problem. Now try these... Input: 1 1 2147483647 1 1 2147483647 2 2147483647 2147483647 2 2147483647 214748364 214748364 2147483647 1 0 -3 -2 Output: Case 1: A = 1, limit = 1, number of terms = 1 Case 2: A = 2147483647, limit = 1, number of ter...
Mon Oct 27, 2003 9:01 pm
Forum: Off topic (General chit-chat)
Topic: Should cutted source code
Replies: 13
Views: 4411
Studying many source codes I learnt a lot of things which I did not find in the book. When I was a novice ACM solver I even did't know how to take inputs until End Of File. Source code postings of few guys I did understand. There are a number of people don't know that they should not use clrscr(), g...
Sun Oct 26, 2003 10:48 pm
Forum: Volume 101 (10100-10199)
Topic: 10170 - The Hotel with Infinite Rooms
Replies: 20
Views: 10097
I am a very weak analytical thinker, so that I have used neither binary search nor derived any formula. I have just used a staright forward method.. (complete brute force).

Code: Select all

``````i=s+1, total=s

begin_of_the_loop
if not (total<d) break
total = total + i;
i = i + 1
end_of_loop
print(i-1)``````
Hope it helps!
Sun Oct 26, 2003 10:32 pm
Forum: Volume 5 (500-599)
Topic: 543 - Goldbach's Conjecture
Replies: 109
Views: 25898
Have you ever heard of Erasthostenes Sieve (how the hell do you write it??) What a way of talking!!!! [c]int isPrime(unsigned long long p) { unsigned long long i; for(i=2;i<=sqrt(p);i++) if(!(p%i)) return 0; return 1; }[/c] Trust me, this function is enough for this problem, whenever you need to ch...
Sun Oct 26, 2003 10:25 pm
Forum: Volume 5 (500-599)
Topic: 579 - Clock Hands
Replies: 44
Views: 14710
I don't understand why these while loops (except for taking inputs) are necessary. Morning, just derive an equation where there will only be minutes and hour and nothing else, no more loops. Hope it helps.
Sun Oct 26, 2003 9:40 pm
Forum: Off topic (General chit-chat)
Topic: How old are you? Statistics.
Replies: 121
Views: 178803
Hi I am Tanzim Saqib from Bangladesh, will be 19 soon . Basically I have been trying to be a software developer and do work with VB, Java, C/C++, Scripting languages, ASP, Win32 API etc. I am a member since December 2003, but haven't worked hard on ACM. Yet, I have set a problem - 10490 Mr. Azad and...
Sun Oct 26, 2003 9:23 pm
Forum: Off topic (General chit-chat)
Topic: A programmer and his wife !
Replies: 0
Views: 1581

### A programmer and his wife !

One of my old friends forwarded me this story couple of days ago... hope you'll enjoy! SCENE: A wife is waiting for her husband who is a programmer. After some time, the husband arrives. HUSBAND: (Opening the door and entering in) Hi dear! I am LOGGED IN. WIFE: Thanks God that you have arrived. Have...
Fri Jun 06, 2003 6:14 pm
Forum: Volume 4 (400-499)
Topic: 488 - Triangle Wave
Replies: 270
Views: 34584