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

×

WA on A4, need help!

Here is my code and it is giving right answer on almost every test case I checked. I'm still not able to find the error. http://www.codechef.com/viewsolution/6325213 would love anyone who takes time to read this post and help. Thanks! :)

asked 21 Feb '15, 15:30

h1ashdr%40gon's gravatar image

3★h1ashdr@gon
2912319
accept rate: 10%

edited 21 Feb '15, 16:55

Your code prints one extra " 0 " in case of power of 10's

For example test cases :
3
10 2
100 5
1000000000 9

and your output is
10 000
10000 000000
100000000 0000000000

Notice one extra 0 here at the second part of your output ( for last k digits).

Also your code is giving wrong answer for case 8 8, i.e., ( $8^8$ and 8 digits of it).
It outputs result as 16777215 16777216 but it should be 16777216 16777216.

(21 Feb '15, 15:51) mediocoder3★

There, I fixed this issue. Still getting WA. http://ideone.com/dj114C

(21 Feb '15, 17:12) h1ashdr@gon3★
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,175
×1,056
×44
×7

question asked: 21 Feb '15, 15:30

question was seen: 1,337 times

last updated: 21 Feb '15, 17:13