<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" 
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:meneame="http://meneame.net/faq-es.php"
 >
<channel>
	<title>Problemas: comentarios [2845916]</title>
	<link>http://www.meneame.net</link>
	<image><title>www.meneame.net</title><link>http://www.meneame.net</link><url>http://cdn.mnmstatic.net/m/Problemas/img/mnm/eli-rss.png</url></image>
	<description>Sitio colaborativo de publicación y comunicación entre blogs</description>
	<pubDate>Mon, 23 Oct 2017 19:40:58 +0000</pubDate>
	<generator>http://blog.meneame.net/</generator>
	<language>es</language>
	<item>
		<meneame:comment_id>22923913</meneame:comment_id>
		<meneame:link_id>2845916</meneame:link_id>
		<meneame:order>10</meneame:order>
		<meneame:user>--14466--</meneame:user>
		<meneame:votes>0</meneame:votes>
		<meneame:karma>9</meneame:karma>
		<meneame:url>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5</meneame:url>
		<title>#10 Múltiplos de 3 o 5</title>
		<link>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c010#c-10</link>
		<pubDate>Mon, 23 Oct 2017 19:40:58 +0000</pubDate>
		<dc:creator>--14466--</dc:creator>
		<guid>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c010#c-10</guid>
		<description><![CDATA[<p><a class="tooltip c:2845916-9" href="https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c09#c-9" rel="nofollow">#9</a> Era evidente con printf(&#34;%li&#34;,n1+n2<b>-</b>n3); <br />
Es que eso de  hackerank es un vicio. Gracias de nuevo! <img data-src="https://cdn.mnmstatic.net/v_149/img/menemojis/36/lol.gif" alt="xD" title=":lol: xD" width="18" height="18" src="https://cdn.mnmstatic.net/v_149/img/g.gif" class="emoji lazy" /></p><p>&#187;&nbsp;autor: <strong>--14466--</strong></p>]]></description>
	</item>

	<item>
		<meneame:comment_id>22920700</meneame:comment_id>
		<meneame:link_id>2845916</meneame:link_id>
		<meneame:order>9</meneame:order>
		<meneame:user>--92492--</meneame:user>
		<meneame:votes>1</meneame:votes>
		<meneame:karma>29</meneame:karma>
		<meneame:url>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5</meneame:url>
		<title>#9 Múltiplos de 3 o 5</title>
		<link>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c09#c-9</link>
		<pubDate>Mon, 23 Oct 2017 14:34:13 +0000</pubDate>
		<dc:creator>--92492--</dc:creator>
		<guid>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c09#c-9</guid>
		<description><![CDATA[<p><a class="tooltip c:2845916-8" href="https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c08#c-8" rel="nofollow">#8</a> porque ha ido directito a hackerrank <img data-src="https://cdn.mnmstatic.net/v_149/img/menemojis/36/smiley.png" alt=":-)" title=":-)" width="18" height="18" src="https://cdn.mnmstatic.net/v_149/img/g.gif" class="emoji lazy" /></p><p>&#187;&nbsp;autor: <strong>--92492--</strong></p>]]></description>
	</item>

	<item>
		<meneame:comment_id>22920696</meneame:comment_id>
		<meneame:link_id>2845916</meneame:link_id>
		<meneame:order>8</meneame:order>
		<meneame:user>--165145--</meneame:user>
		<meneame:votes>0</meneame:votes>
		<meneame:karma>18</meneame:karma>
		<meneame:url>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5</meneame:url>
		<title>#8 Múltiplos de 3 o 5</title>
		<link>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c08#c-8</link>
		<pubDate>Mon, 23 Oct 2017 14:33:48 +0000</pubDate>
		<dc:creator>--165145--</dc:creator>
		<guid>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c08#c-8</guid>
		<description><![CDATA[<p><a class="tooltip c:2845916-7" href="https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c07#c-7" rel="nofollow">#7</a>, lo curioso es que <a class="tooltip c:2845916-2" href="https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c02#c-2" rel="nofollow">#2</a> también te ha entendido <img data-src="https://cdn.mnmstatic.net/v_149/img/menemojis/36/lol.gif" alt="xD" title=":lol: xD" width="18" height="18" src="https://cdn.mnmstatic.net/v_149/img/g.gif" class="emoji lazy" /></p><p>&#187;&nbsp;autor: <strong>--165145--</strong></p>]]></description>
	</item>

	<item>
		<meneame:comment_id>22920678</meneame:comment_id>
		<meneame:link_id>2845916</meneame:link_id>
		<meneame:order>7</meneame:order>
		<meneame:user>--92492--</meneame:user>
		<meneame:votes>0</meneame:votes>
		<meneame:karma>11</meneame:karma>
		<meneame:url>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5</meneame:url>
		<title>#7 Múltiplos de 3 o 5</title>
		<link>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c07#c-7</link>
		<pubDate>Mon, 23 Oct 2017 14:33:01 +0000</pubDate>
		<dc:creator>--92492--</dc:creator>
		<guid>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c07#c-7</guid>
		<description><![CDATA[<p><a class="tooltip c:2845916-6" href="https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c06#c-6" rel="nofollow">#6</a> Mil perdones! Sí efectivamente.</p><p>&#187;&nbsp;autor: <strong>--92492--</strong></p>]]></description>
	</item>

	<item>
		<meneame:comment_id>22920652</meneame:comment_id>
		<meneame:link_id>2845916</meneame:link_id>
		<meneame:order>6</meneame:order>
		<meneame:user>--165145--</meneame:user>
		<meneame:votes>0</meneame:votes>
		<meneame:karma>18</meneame:karma>
		<meneame:url>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5</meneame:url>
		<title>#6 Múltiplos de 3 o 5</title>
		<link>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c06#c-6</link>
		<pubDate>Mon, 23 Oct 2017 14:31:08 +0000</pubDate>
		<dc:creator>--165145--</dc:creator>
		<guid>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c06#c-6</guid>
		<description><![CDATA[<p><a class="tooltip l:2845916" href="https://www.meneame.net/m/Problemas/multiplos-de-3-o-5" rel="nofollow">#0</a>, viendo lo que dice en el enunciado y tu solución en <a class="tooltip c:2845916-3" href="https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c03#c-3" rel="nofollow">#3</a>, creo que lo que en realidad querías calcular es la suma de dichos múltiplos, ¿no?<br />
<br />
De hecho con tu enunciado he entendido que había que sacar una lista con todos los múltiplos y no entendía cómo se podría hacer eso igual de rápido independientemente del tamaño de n.</p><p>&#187;&nbsp;autor: <strong>--165145--</strong></p>]]></description>
	</item>

	<item>
		<meneame:comment_id>22884890</meneame:comment_id>
		<meneame:link_id>2845916</meneame:link_id>
		<meneame:order>5</meneame:order>
		<meneame:user>--92492--</meneame:user>
		<meneame:votes>0</meneame:votes>
		<meneame:karma>11</meneame:karma>
		<meneame:url>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5</meneame:url>
		<title>#5 Múltiplos de 3 o 5</title>
		<link>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c05#c-5</link>
		<pubDate>Thu, 19 Oct 2017 15:37:50 +0000</pubDate>
		<dc:creator>--92492--</dc:creator>
		<guid>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c05#c-5</guid>
		<description><![CDATA[<p><a class="tooltip c:2845916-4" href="https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c04#c-4" rel="nofollow">#4</a> Perdón sí, es resta, es que no puse el método main entero por sencillez.</p><p>&#187;&nbsp;autor: <strong>--92492--</strong></p>]]></description>
	</item>

	<item>
		<meneame:comment_id>22884584</meneame:comment_id>
		<meneame:link_id>2845916</meneame:link_id>
		<meneame:order>4</meneame:order>
		<meneame:user>--14466--</meneame:user>
		<meneame:votes>0</meneame:votes>
		<meneame:karma>9</meneame:karma>
		<meneame:url>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5</meneame:url>
		<title>#4 Múltiplos de 3 o 5</title>
		<link>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c04#c-4</link>
		<pubDate>Thu, 19 Oct 2017 15:05:29 +0000</pubDate>
		<dc:creator>--14466--</dc:creator>
		<guid>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c04#c-4</guid>
		<description><![CDATA[<p><a class="tooltip c:2845916-3" href="https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c03#c-3" rel="nofollow">#3</a> Era más fácil con el modulo/resto &#34;%&#34; pero como has puesto la condición O(1)...<br />
<br />
En DivisibleByBoth creo que debería restar el SumDivisibleBy(15, n) para eliminar una de las sumas cuando se trata de un múltiplo de 3 y de 5 (15 por ejemplo) (15+15-15)</p><p>&#187;&nbsp;autor: <strong>--14466--</strong></p>]]></description>
	</item>

	<item>
		<meneame:comment_id>22884046</meneame:comment_id>
		<meneame:link_id>2845916</meneame:link_id>
		<meneame:order>3</meneame:order>
		<meneame:user>--92492--</meneame:user>
		<meneame:votes>0</meneame:votes>
		<meneame:karma>11</meneame:karma>
		<meneame:url>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5</meneame:url>
		<title>#3 Múltiplos de 3 o 5</title>
		<link>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c03#c-3</link>
		<pubDate>Thu, 19 Oct 2017 14:05:30 +0000</pubDate>
		<dc:creator>--92492--</dc:creator>
		<guid>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c03#c-3</guid>
		<description><![CDATA[<p><a class="tooltip c:2845916-2" href="https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c02#c-2" rel="nofollow">#2</a> Mmmmmm... Parece correcta <img data-src="https://cdn.mnmstatic.net/v_149/img/menemojis/36/smiley.png" alt=":-)" title=":-)" width="18" height="18" src="https://cdn.mnmstatic.net/v_149/img/g.gif" class="emoji lazy" /> Faltan los motivos. En mi caso lo hice asÍ:<br />
<br />
<i>    private static BigInteger SumDivisibleBy(int n, BigInteger p) {<br />
 return n * (p / n) * ((p / n) + 1) / 2;<br />
    }<br />
    <br />
    private static BigInteger DivisibleByBoth(int n) {<br />
 n--; // Minus 1 because is &#34;until&#34;, so not included.<br />
 return SumDivisibleBy(3, n) + SumDivisibleBy(5, n) + SumDivisibleBy(15, n);<br />
    }</i></p><p>&#187;&nbsp;autor: <strong>--92492--</strong></p>]]></description>
	</item>

	<item>
		<meneame:comment_id>22883827</meneame:comment_id>
		<meneame:link_id>2845916</meneame:link_id>
		<meneame:order>2</meneame:order>
		<meneame:user>--14466--</meneame:user>
		<meneame:votes>0</meneame:votes>
		<meneame:karma>9</meneame:karma>
		<meneame:url>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5</meneame:url>
		<title>#2 Múltiplos de 3 o 5</title>
		<link>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c02#c-2</link>
		<pubDate>Thu, 19 Oct 2017 13:45:02 +0000</pubDate>
		<dc:creator>--14466--</dc:creator>
		<guid>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c02#c-2</guid>
		<description><![CDATA[<p><a class="tooltip c:2845916-1" href="https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c01#c-1" rel="nofollow">#1</a> Yo ya he hecho mi parte. <br />
Ahora los matemáticos que saquen la progresión del bucle <img data-src="https://cdn.mnmstatic.net/v_149/img/menemojis/36/smiley.png" alt=":-)" title=":-)" width="18" height="18" src="https://cdn.mnmstatic.net/v_149/img/g.gif" class="emoji lazy" /><br />
{<br />
    long t = 100;<br />
    long n,n1,n2,n3;<br />
    for(int a0 = 0; a0 &#60;= t; a0++)<br />
 {<br />
 n = a0; n1=0; n2=0; n3=0;<br />
 n1=n/3;   n1=3*n1*(n1+1)/2;<br />
 n2=n/5-1; n2=5*n2*(n2+1)/2;<br />
 n3=n/15;  n3=15*n3*(n3+1)/2;<br />
 }<br />
    printf(&#34;%li&#34;,n1+n2-n3);<br />
}<br />
<br />
Muy chulo en enlace. No lo conocía!</p><p>&#187;&nbsp;autor: <strong>--14466--</strong></p>]]></description>
	</item>

	<item>
		<meneame:comment_id>22879471</meneame:comment_id>
		<meneame:link_id>2845916</meneame:link_id>
		<meneame:order>1</meneame:order>
		<meneame:user>--92492--</meneame:user>
		<meneame:votes>1</meneame:votes>
		<meneame:karma>20</meneame:karma>
		<meneame:url>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5</meneame:url>
		<title>#1 Múltiplos de 3 o 5</title>
		<link>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c01#c-1</link>
		<pubDate>Thu, 19 Oct 2017 07:07:30 +0000</pubDate>
		<dc:creator>--92492--</dc:creator>
		<guid>https://www.meneame.net/m/Problemas/multiplos-de-3-o-5/c01#c-1</guid>
		<description><![CDATA[<p>Y como no sé editarlo, si quieres probar tu solución en una plataforma que te la prueba, aquí: <br />
<a href="https://www.hackerrank.com/contests/projecteuler/challenges/euler001/problem" title="www.hackerrank.com/contests/projecteuler/challenges/euler001/problem" rel="nofollow">www.hackerrank.com/contests/projecteuler/challenges/euler001/problem</a><br />
<br />
Podrás programarlo en tu lenguaje favorito, y hackerrank se encargará de hacerle los unit tests y darte una nota. El objetivo es el 100% <img data-src="https://cdn.mnmstatic.net/v_149/img/menemojis/36/smiley.png" alt=":-)" title=":-)" width="18" height="18" src="https://cdn.mnmstatic.net/v_149/img/g.gif" class="emoji lazy" /></p><p>&#187;&nbsp;autor: <strong>--92492--</strong></p>]]></description>
	</item>

</channel>
</rss>
