Forum: C++ Feb 1st, 2009 |
| Replies: 6 Views: 687 Thanks again dude. Will get back to you after trying out your method. |
Forum: C++ Jan 31st, 2009 |
| Replies: 6 Views: 687 Ok, I will attach the whole file along with this post. |
Forum: C++ Jan 31st, 2009 |
| Replies: 4 Views: 508 I agree with chris. Considering your first question, another way to get the digits in reverse order is storing remainder, keep dividing the original no by 10 until the number comes to a single digit.... |
Forum: C++ Jan 31st, 2009 |
| Replies: 6 Views: 687 If i had the solution, i wouldn't be posting here would i? ;) I tried to solve that problem and came up with a code. The code doesnt have any syntax errors, compiles with a single warning. But im not... |
Forum: C++ Jan 31st, 2009 |
| Replies: 6 Views: 687 PROBLEM :
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest palindrome made from the... |
Forum: C++ Jan 23rd, 2009 |
| Replies: 18 Views: 1,889 Thanks Adam. I will check for the out of bounds possibility while using count. |
Forum: C++ Jan 23rd, 2009 |
| Replies: 18 Views: 1,889 Sorry, i forgot to replace all the FOR loops with the WHILE loop you gave me. When i replaced all of them, the code was working. But it deletes elements other than multiples of 2 from the vector.... |
Forum: C++ Jan 23rd, 2009 |
| Replies: 18 Views: 1,889 StuXYZ & Rashakil, I was about to do wat stuXYZ has suggested. But i thought that i would check if im able to find prime nos as given in the wikipedia link (a simpler version). And i ended up in... |
Forum: C++ Jan 23rd, 2009 |
| Replies: 18 Views: 1,889 I've pasted the code which i came up with when i was trying to implement SoE and there seems to be some problems with the vector. Can you look into it plz? |
Forum: C++ Jan 22nd, 2009 |
| Replies: 18 Views: 1,889 Hey Adam, I tried this code(with the alteration of it++) in place of the for loop. But i keep getting the same error. Do i have to replace any other part of the code? |
Forum: C++ Jan 22nd, 2009 |
| Replies: 18 Views: 1,889 To be honest, my math is below par. Im working on improving it. Can you suggest me a better approach to this problem plz? |
Forum: C++ Jan 22nd, 2009 |
| Replies: 18 Views: 1,889 Thanks Adam. I will try out wat you have suggested. |
Forum: C++ Jan 21st, 2009 |
| Replies: 18 Views: 1,889 QUESTION: The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
I was trying to solve this problem. I was previously suggested to use the... |
Forum: C++ Jan 21st, 2009 |
| Replies: 5 Views: 953 Thanks for explaining the logic dude. Am not that bright in math, im currently working on improving that part :) As per the code part, i thought continue statement will stop the current iteration,... |
Forum: C++ Jan 21st, 2009 |
| Replies: 5 Views: 953 Ya. The first if loop checks for modulo of i, then the next if loop checks if i=19. If the first if loop is false, then in the else part i have chosen the next multiple of 20 to test. But, If both... |
Forum: C++ Jan 20th, 2009 |
| Replies: 5 Views: 953 QUESTION : 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest number that is evenly divisible by all of the numbers... |
Forum: C++ Jan 9th, 2009 |
| Replies: 2 Views: 1,092 Thanks pal. I knew that there was a point to limit my prime factor search, but forgot the exact condition. I accept the fact that my math is below avg. Gotta improve a lot on that. I dont mind harsh... |
Forum: C++ Jan 8th, 2009 |
| Replies: 2 Views: 1,092 Ques:
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
I came up with the following code. This did compile in VC++ Express Edition... |
Forum: C++ Aug 12th, 2008 |
| Replies: 7 Views: 504 |
Forum: C++ Aug 12th, 2008 |
| Replies: 7 Views: 504 Thanks ancient dragon, your suggestion worked. But i still have some doubts.
1) Iterator is a pointer or subscript
2) When i increment the int vector's iterator, it increases by 1 or the size... |
Forum: C++ Aug 12th, 2008 |
| Replies: 7 Views: 504 it is an integer pointer or something similar to an array subscript? |
Forum: C++ Aug 12th, 2008 |
| Replies: 7 Views: 504 Oops. Forgot that part. Will an if loop checking if(it++ != tx.end()) help me solve this problem? |
Forum: C++ Aug 12th, 2008 |
| Replies: 7 Views: 504 Hey ppl,
Im currently writing a code for the following problem.
"
Problem Statement
***Note: Please keep programs under 7000 characters in length. Thank you
Class... |
Forum: C++ Aug 10th, 2008 |
| Replies: 3 Views: 645 Hey salem, checked by removing the main() which i coded. The code is working fine after that. Thanks for the suggestion. |
Forum: C++ Aug 10th, 2008 |
| Replies: 3 Views: 645 In this case, if i comment out the main() which i created, the method will be executed automatically by the other main()? |
Forum: C++ Aug 10th, 2008 |
| Replies: 3 Views: 645 Hey ppl,
Im trying to solve some problems for topcoder website for practice purposes. But the compiler shows the following error for the codes i've been compiling. I have no problems... |
Forum: C++ Aug 10th, 2008 |
| Replies: 11 Views: 1,084 |
Forum: C++ Aug 10th, 2008 |
| Replies: 11 Views: 1,084 @Waltp
I don't need an array for this, but i need it for the next step. Plz see my first post. It has the complete statement. |
Forum: C++ Aug 9th, 2008 |
| Replies: 11 Views: 1,084 @Sanzilla
Thanks man. Im not aware of Vector concept in STL. Any links that can help me?
@gregorynoob
Will the concept work well if the number that repeats isn't in the starting position of... |
Forum: C++ Aug 9th, 2008 |
| Replies: 11 Views: 1,084 @sanzilla
You are right. I don't need just answers. I figured out till extracting digits. I want info on how to proceed further. I can create a very large array to store the set T(X) which results... |
Forum: C++ Aug 9th, 2008 |
| Replies: 11 Views: 1,084 Sorry, forgot to mention the algorithm i had in mind. I can proceed till generating the T(X) set by seperating the digits. Iam unsure about how to proceed further without wasting memory/creating... |
Forum: C++ Aug 9th, 2008 |
| Replies: 11 Views: 1,084 Hey ppl,
I was browsing thro the topcoder sample problems and came up with this one. Plz suggest some good algorithm for this.
Problem Statement
***Note: Please keep programs... |
Forum: C++ Aug 6th, 2008 |
| Replies: 13 Views: 995 Thanks VernonDozier. That explains things. And do you have any clue about why im getting the error which i've edited in my previous post? |
Forum: C++ Aug 6th, 2008 |
| Replies: 13 Views: 995 Thanks a lot prabhakar. I forgot to mention what the code is for. Forgive me as this is my first post. This program is for calculating the number of letters from words with only alphabets and the... |
Forum: C++ Aug 6th, 2008 |
| Replies: 13 Views: 995 Thanks for the suggestion man. Will try it now. |
Forum: C++ Aug 6th, 2008 |
| Replies: 13 Views: 995 My code had some logical errors in it. I got some output, but its not the expected output for the problem. This was when i used Borland C++. When i pasted the same code in the topcoder's compiler, im... |
Forum: C++ Aug 6th, 2008 |
| Replies: 13 Views: 995 I didn't get any errors in Borland C++ compiler. I was just getting wrong outputs. But when i used this code on the compiler given in topcoder application, it gives me linking error. And i've tried... |
Forum: C++ Aug 6th, 2008 |
| Replies: 13 Views: 995 Guys,
Im not very experienced in C++. I was practicing problems from topcoder to improve my knowledge in C++. I've posted the code i used for solving a problem statement given by topcoder... |