Re: [gcj] Round 1 C -B in c++
Hello, There are several reasons why the same code C/C++ might execute differently on different processors. The most probable is that the size of int variables can vary from 16, 32, or 64 bits. I'd try declaring all of your int variables as long and see if that makes a difference. Good luck, -Ken On Sunday 07 March 2010 12:31:23 Stephan09 wrote: > Hello! > > I was practicing with some old problems and tried to solve the Center > of Mass Problem of Round 1C - B in 2009. > I correctly understand the solution and the winning c++ codes. But > when I compile the winning codes on my pc and calculate the solutions > for the practice input, I allways get that the submitted solution is > incorrect. > > Does anyone know how that can be? I didnt change any of the code. Is > it possible that, when using c++, the calculated values depend on the > processor in use? > Thus, is it possible that one has to write different c++ codes for > different processors? > > Thanx a lot! > Stephan -- You received this message because you are subscribed to the Google Groups "google-codejam" group. To post to this group, send email to google-c...@googlegroups.com. To unsubscribe from this group, send email to google-code+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-code?hl=en.
Re: [gcj] Round 1 C -B in c++
Can you send through some sample input and output? On Sun, Mar 7, 2010 at 8:31 PM, Stephan09 wrote: > Hello! > > I was practicing with some old problems and tried to solve the Center > of Mass Problem of Round 1C - B in 2009. > I correctly understand the solution and the winning c++ codes. But > when I compile the winning codes on my pc and calculate the solutions > for the practice input, I allways get that the submitted solution is > incorrect. > > Does anyone know how that can be? I didnt change any of the code. Is > it possible that, when using c++, the calculated values depend on the > processor in use? > Thus, is it possible that one has to write different c++ codes for > different processors? > > Thanx a lot! > Stephan > > -- > You received this message because you are subscribed to the Google Groups > "google-codejam" group. > To post to this group, send email to google-c...@googlegroups.com. > To unsubscribe from this group, send email to > google-code+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-code?hl=en. > > -- You received this message because you are subscribed to the Google Groups "google-codejam" group. To post to this group, send email to google-c...@googlegroups.com. To unsubscribe from this group, send email to google-code+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-code?hl=en.
Re: [gcj] Round 1 C -B in c++
better make it double On Tue, Mar 9, 2010 at 1:49 AM, Ken Corbin wrote: > Hello, > > There are several reasons why the same code C/C++ might execute differently > on > different processors. The most probable is that the size of int variables > can vary from 16, 32, or 64 bits. I'd try declaring all of your int > variables as long and see if that makes a difference. > > Good luck, > -Ken > > On Sunday 07 March 2010 12:31:23 Stephan09 wrote: > > Hello! > > > > I was practicing with some old problems and tried to solve the Center > > of Mass Problem of Round 1C - B in 2009. > > I correctly understand the solution and the winning c++ codes. But > > when I compile the winning codes on my pc and calculate the solutions > > for the practice input, I allways get that the submitted solution is > > incorrect. > > > > Does anyone know how that can be? I didnt change any of the code. Is > > it possible that, when using c++, the calculated values depend on the > > processor in use? > > Thus, is it possible that one has to write different c++ codes for > > different processors? > > > > Thanx a lot! > > Stephan > > > > -- > You received this message because you are subscribed to the Google Groups > "google-codejam" group. > To post to this group, send email to google-c...@googlegroups.com. > To unsubscribe from this group, send email to > google-code+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/google-code?hl=en. > > -- You received this message because you are subscribed to the Google Groups "google-codejam" group. To post to this group, send email to google-c...@googlegroups.com. To unsubscribe from this group, send email to google-code+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-code?hl=en.
Re: [gcj] Round 1 C -B in c++
Whose solution was it? One round we had a contestant who used an unusual compiler, and had a solution that didn't work in gcc. Maybe this is that one? On Mar 8, 2010 7:02 AM, "Stephan09" wrote: Hello! I was practicing with some old problems and tried to solve the Center of Mass Problem of Round 1C - B in 2009. I correctly understand the solution and the winning c++ codes. But when I compile the winning codes on my pc and calculate the solutions for the practice input, I allways get that the submitted solution is incorrect. Does anyone know how that can be? I didnt change any of the code. Is it possible that, when using c++, the calculated values depend on the processor in use? Thus, is it possible that one has to write different c++ codes for different processors? Thanx a lot! Stephan -- You received this message because you are subscribed to the Google Groups "google-codejam" group. To post to this group, send email to google-c...@googlegroups.com. To unsubscribe from this group, send email to google-code+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-code?hl=en. -- You received this message because you are subscribed to the Google Groups "google-codejam" group. To post to this group, send email to google-c...@googlegroups.com. To unsubscribe from this group, send email to google-code+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-code?hl=en.
Re: [gcj] Round 1 C -B in c++
I also do not know the answer it just happened and i really don't anything about breaking codes coz i am just a browser & not a programmer nor involve or a member of any group.. i just use the mouse to solve thing i really wanted to see.. 2010/3/8 Stephan09 > Hello! > > I was practicing with some old problems and tried to solve the Center > of Mass Problem of Round 1C - B in 2009. > I correctly understand the solution and the winning c++ codes. But > when I compile the winning codes on my pc and calculate the solutions > for the practice input, I allways get that the submitted solution is > incorrect. > > Does anyone know how that can be? I didnt change any of the code. Is > it possible that, when using c++, the calculated values depend on the > processor in use? > Thus, is it possible that one has to write different c++ codes for > different processors? > > Thanx a lot! > Stephan > > -- > You received this message because you are subscribed to the Google Groups > "google-codejam" group. > To post to this group, send email to google-c...@googlegroups.com. > To unsubscribe from this group, send email to > google-code+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/google-code?hl=en. > > -- You received this message because you are subscribed to the Google Groups "google-codejam" group. To post to this group, send email to google-c...@googlegroups.com. To unsubscribe from this group, send email to google-code+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-code?hl=en.