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

×

# TLE in SEGPROD (NOVEMBOR LONG CHALLENGE)

 1 Can someone please spot out the time consuming factors in my code for the question https://www.codechef.com/NOV17/problems/SEGPROD/ from Novembor Long Challenge and how to get AC in all 3 subtasks(where to optimize! :(). I tried a lot to optimize but this is the bare minimum thing that has to be calculated in order to reach to the final answer. Here's the link to my submission : https://www.codechef.com/viewsolution/16258320 I am getting TLE in one test file each of subtask 1 and 2.. and TLE in the first 2 test files of subtask 3. Thanks, in advance. :) asked 14 Nov '17, 00:36 261●6 accept rate: 3%

One Answer:
 1 I have just posted editorial for this problem here. Exactly explaining how to optimize as constraints were too tight. answered 14 Nov '17, 00:40 4.0k●31●105 accept rate: 22% I have read your post, bro. :) But can you just take a quick glance at my code and probably say what can be some possible TLE causing factors and how can I rectify to get an AC. :) That would of greattt help ! (14 Nov '17, 00:43) I'm not much in c++, so i can't say much. But i guess vectors are making your solution slow. Prefer using arrays when constraints are one of the tightest i have ever seen (14 Nov '17, 00:44) Use arrays in place of vectors. Maximum number of prime factors of P will be 10. Enjoy coding! (14 Nov '17, 00:55)
 toggle preview community wiki:
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:

×729
×427
×365
×67
×14

question asked: 14 Nov '17, 00:36

question was seen: 310 times

last updated: 14 Nov '17, 00:55