4

Integer working in CPP but Not working in Java

 1 year ago
source link: https://codeforces.com/blog/entry/119124
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Integer working in CPP but Not working in Java

Just wanted to get some clarification, for the problem D of today's contest (Codeforces Round 891 (Div. 3)). I got this weird error (runtime error) in the following submissions (using java):

When I submitted equivalent code using long, it worked (using java): - https://codeforces.com/contest/1857/submission/217686813

Using int, cpp code worked though: - https://codeforces.com/contest/1857/submission/217741962

Anyone has any idea what might have happened? I would really appreciate the help. Thanks in advance.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK