Meguhine's blog

By Meguhine, history, 6 months ago, In English

Code Link

element size
e $$$n$$$
a $$$S$$$
sp $$$n$$$
sp_id $$$\sqrt{S}$$$
sp_qry $$$Q$$$
qry $$$Q\cdot 2$$$
nm_qry $$$Q\cdot\sqrt{S}$$$
ans $$$Q$$$
mp $$$K$$$
rua $$$Q$$$
pp $$$S$$$
pt $$$S$$$
pa $$$n$$$
fa $$$n$$$
sz $$$n$$$
ok $$$n$$$

total: $$$6n + 3S + 5Q + K + (Q+1)\cdot \sqrt{S}$$$

if we take $$$3\cdot 10^5$$$ for $$$n,S,Q,K$$$, there would be

$$$ \begin{eqnarray} &&15\cdot 3\cdot10^5+(3\cdot10^5+1)*\sqrt{3\cdot10^5}\\ &=&4500000+164317314\\ &=&168817314\enspace\text{ints} \end{eqnarray} $$$

which would take $$$\dfrac{168817314\cdot 4}{1024\cdot 1024}=644\enspace\text{MB}$$$

that's way smaller than $$$1\enspace\text{GB}$$$

so why did my code get MLE ???

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
6 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

upd: I got it, nevermind now.