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

×

MKTHNUM from SPOJ--help required

question link : http://www.spoj.com/problems/MKTHNUM/ my code link : https://ideone.com/JLNF6b im getting TLE...donno whether my logic is correct or not...!! if wrong pls correct ...if correct help me in getting a decent approach !! thanks in advance : )

asked 31 Aug '17, 22:49

msd_007's gravatar image

1★msd_007
3178
accept rate: 5%

I suspect that its the merging of vectors thats giving you TLE. It depends on linearly on size of vector (afaik) and can cause a TLE if limit is strict. I am looking at possible approaches.

(01 Sep '17, 00:18) vijju123 ♦♦5★

Is my logic correct bro @vijju123 ??

(01 Sep '17, 10:47) msd_0071★

The logic seems correct bro. Just try to get around without using vectors. Also, I think concept of persistence is required.

(01 Sep '17, 16:19) vijju123 ♦♦5★

how can we solve it using persistant segment tree ??

(03 Sep '17, 00:04) msd_0071★
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:

×699
×74
×28

question asked: 31 Aug '17, 22:49

question was seen: 237 times

last updated: 03 Sep '17, 00:04