You are not logged in. Please login at www.codechef.com to post your questions!

×

Same code in Java gives RE that gives AC in C++.

0
1

I was doing this question. I implemented the same codes in Java and C++. This java code gives RE while the same code when implemented in C++(here) gives AC. Why is this happening?

asked 19 Jan '14, 10:36

nikunjbanka's gravatar image

4★nikunjbanka
46358
accept rate: 0%

i dont think they are quite same then

(19 Jan '14, 10:41) garakchy1★

In C++, you are using unsigned long long, but in Java you are using long. Range of unsigned long long is two times the range of long. Since, long is not sufficient for this problem and there is no concept as unsigned in Java, you should use BigInteger in Java to get AC.

link

answered 19 Jan '14, 11:23

kapildd's gravatar image

5★kapildd
25939
accept rate: 7%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×1,911
×1,302

question asked: 19 Jan '14, 10:36

question was seen: 832 times

last updated: 19 Jan '14, 11:23