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

×

TLE in WITMATH

How can I further optimise my code?I've got several TLE'S in it.I have used Rabin-Miller primality testing.Here's my link to code:

http://www.codechef.com/viewsolution/3774210

asked 16 Apr '14, 19:53

knb_dtu's gravatar image

2★knb_dtu
410620
accept rate: 22%


Your function for Multiplication is taking logn time that's why it is giving TLE.... I had also same problem when I was solving This problem . But after checking other solutions I found that we can multiply two numbers in constant time . You can see my solution here http://www.codechef.com/viewsolution/2911366

link

answered 18 Apr '14, 18:10

hatim009's gravatar image

3★hatim009
46421122
accept rate: 8%

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:

×2,738
×199
×16
×12
×1

question asked: 16 Apr '14, 19:53

question was seen: 943 times

last updated: 18 Apr '14, 18:10