mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-22 04:42:10 +08:00
Documentation for c26eea874d
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: range_queries/mo.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -129,8 +129,8 @@ $(function(){initNavTree('d3/d53/mo_8cpp_source.html','../../'); initResizable(t
|
||||
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="keyword">using namespace </span>std;</div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 1e6 + 5;</div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="keywordtype">int</span> a[<a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>], bucket[<a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>], cnt[<a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>];</div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="keyword">const</span> <span class="keywordtype">int</span> N = 1e6 + 5;</div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="keywordtype">int</span> a[N], bucket[N], cnt[N];</div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="keywordtype">int</span> bucket_size;</div>
|
||||
<div class="foldopen" id="foldopen00009" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"><a class="line" href="../../dd/d1b/structquery.html"> 9</a></span><span class="keyword">struct </span><a class="code hl_struct" href="../../dd/d1b/structquery.html">query</a> {</div>
|
||||
@@ -144,7 +144,7 @@ $(function(){initNavTree('d3/d53/mo_8cpp_source.html','../../'); initResizable(t
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keywordflow">if</span> (cnt[a[index]] == 1)</div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> ans++;</div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span>}</div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#a28083ecac6eb94b643281875c8665931">remove</a>(<span class="keywordtype">int</span> index) {</div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="keywordtype">void</span> remove(<span class="keywordtype">int</span> index) {</div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> cnt[a[index]]--;</div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordflow">if</span> (cnt[a[index]] == 0)</div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> ans--;</div>
|
||||
@@ -173,7 +173,7 @@ $(function(){initNavTree('d3/d53/mo_8cpp_source.html','../../'); initResizable(t
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keywordflow">for</span> (i = 0; i < t; i++) {</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keywordtype">int</span> L = q[i].l, R = q[i].r;</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordflow">while</span> (left < L) {</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#a28083ecac6eb94b643281875c8665931">remove</a>(left);</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> remove(left);</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> left++;</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> }</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordflow">while</span> (left > L) {</div>
|
||||
@@ -185,7 +185,7 @@ $(function(){initNavTree('d3/d53/mo_8cpp_source.html','../../'); initResizable(t
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> right++;</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> }</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keywordflow">while</span> (right > R + 1) {</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#a28083ecac6eb94b643281875c8665931">remove</a>(right - 1);</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> remove(right - 1);</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> right--;</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> }</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> bucket[q[i].i] = ans;</div>
|
||||
@@ -195,8 +195,6 @@ $(function(){initNavTree('d3/d53/mo_8cpp_source.html','../../'); initResizable(t
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span>}</div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a1b74d828b33760094906797042b89442"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">numerical_methods::simpson_method::k</a></div><div class="ttdeci">double k(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d18/composite__simpson__rule_8cpp_source.html#l00117">composite_simpson_rule.cpp:117</a></div></div>
|
||||
<div class="ttc" id="agenerate__parentheses_8cpp_html_gae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">Main function.</div><div class="ttdef"><b>Definition</b> <a href="../../dd/d1e/generate__parentheses_8cpp_source.html#l00110">generate_parentheses.cpp:110</a></div></div>
|
||||
<div class="ttc" id="anamespacedouble__hashing_html_a28083ecac6eb94b643281875c8665931"><div class="ttname"><a href="../../d0/d65/namespacedouble__hashing.html#a28083ecac6eb94b643281875c8665931">double_hashing::remove</a></div><div class="ttdeci">void remove(int key)</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d80/double__hash__hash__table_8cpp_source.html#l00199">double_hash_hash_table.cpp:199</a></div></div>
|
||||
<div class="ttc" id="asparse__table_8cpp_html_a10f3ffb3f6f7e1b83d556b9c8de89a5d"><div class="ttname"><a href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">data_structures::sparse_table::N</a></div><div class="ttdeci">constexpr uint32_t N</div><div class="ttdoc">A struct to represent sparse table for min() as their invariant function, for the given array A....</div><div class="ttdef"><b>Definition</b> <a href="../../d8/dab/sparse__table_8cpp_source.html#l00048">sparse_table.cpp:48</a></div></div>
|
||||
<div class="ttc" id="astructquery_html"><div class="ttname"><a href="../../dd/d1b/structquery.html">query</a></div><div class="ttdef"><b>Definition</b> <a href="#l00009">mo.cpp:9</a></div></div>
|
||||
<div class="ttc" id="auint128__t_8hpp_html_a3ff77262ffd6743df5b808d41382a6f3"><div class="ttname"><a href="../../da/d41/uint128__t_8hpp.html#a3ff77262ffd6743df5b808d41382a6f3">add</a></div><div class="ttdeci">std::string add(const std::string &first, const std::string &second)</div><div class="ttdoc">Adding two string.</div><div class="ttdef"><b>Definition</b> <a href="../../da/d41/uint128__t_8hpp_source.html#l00038">uint128_t.hpp:38</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
@@ -205,7 +203,7 @@ $(function(){initNavTree('d3/d53/mo_8cpp_source.html','../../'); initResizable(t
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_074119ce3a874b57120c49a0cc4bb5ad.html">range_queries</a></li><li class="navelem"><b>mo.cpp</b></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user