|
|
back to boardShow all messages Hide all messagesI’ve AC, but I still have a question! My first program used “unsigned long” type, and didn’t pass Test 12 Then I changed all types to “unsigned long long” , and program was AC. So, my question is why my first program failed on Test12? As you know n,m<=2^31-1;So, the biggest result is 0xFFFFFFFD! This result can be represented by unsigned long! So, I didn’t announce my program, because it is bad style. I’m sure that those programmers who solved this issue can understand my question…. Best Wishes, Veniamin. Each of n and m is <= 2^31-1. Yes, they are unsigned long. But max unsigned long + 1 is? Overflow, of course !! Your solution doesn't print n or m exactly but you have to calculate either 2*m or 2*n, aren't you? Thanks.I also meet this question. |
|
|