From fecb10e6112cb5c3fa288c9bccce5cb567198a22 Mon Sep 17 00:00:00 2001 From: camperbot Date: Fri, 19 Nov 2021 10:31:54 -0800 Subject: [PATCH] chore(i18n,curriculum): processed translations (#44221) --- ...oblem-316-numbers-in-decimal-expansions.md | 32 ++++++++------ .../project-euler/problem-317-firecracker.md | 16 +++---- .../project-euler/problem-318-2011-nines.md | 42 ++++++------------- .../problem-319-bounded-sequences.md | 26 ++++++------ ...-factorials-divisible-by-a-huge-integer.md | 18 ++++---- .../problem-321-swapping-counters.md | 26 +++++++----- ...2-binomial-coefficients-divisible-by-10.md | 16 +++---- ...itwise-or-operations-on-random-integers.md | 23 +++++----- .../problem-324-building-a-tower.md | 18 ++++---- .../problem-325-stone-game-ii.md | 24 +++++------ .../problem-326-modulo-summations.md | 24 ++++++----- .../problem-327-rooms-of-doom.md | 36 +++++++++------- .../problem-328-lowest-cost-search.md | 32 +++++++------- .../project-euler/problem-329-prime-frog.md | 28 ++++++++----- .../problem-330-eulers-number.md | 28 ++++++------- .../project-euler/problem-331-cross-flips.md | 26 ++++++------ .../problem-332-spherical-triangles.md | 26 ++++++++---- .../problem-333-special-partitions.md | 26 ++++++------ .../problem-334-spilling-the-beans.md | 24 ++++++----- .../problem-335-gathering-the-beans.md | 20 +++++---- .../problem-336-maximix-arrangements.md | 32 ++++++++------ ...problem-337-totient-stairstep-sequences.md | 26 ++++++------ ...blem-338-cutting-rectangular-grid-paper.md | 26 ++++++------ .../problem-339-peredur-fab-efrawg.md | 18 ++++---- .../problem-340-crazy-function.md | 22 +++++----- 25 files changed, 337 insertions(+), 298 deletions(-) diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-316-numbers-in-decimal-expansions.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-316-numbers-in-decimal-expansions.md index 4a2821b24e..56725ea20d 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-316-numbers-in-decimal-expansions.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-316-numbers-in-decimal-expansions.md @@ -1,6 +1,6 @@ --- id: 5900f4a81000cf542c50ffbb -title: 'Problem 316: Numbers in decimal expansions' +title: 'Problema 316: Números em expansões decimais' challengeType: 5 forumTopicId: 301972 dashedName: problem-316-numbers-in-decimal-expansions @@ -8,26 +8,34 @@ dashedName: problem-316-numbers-in-decimal-expansions # --description-- -Let p = p1 p2 p3 ... be an infinite sequence of random digits, selected from {0,1,2,3,4,5,6,7,8,9} with equal probability. +Considere $p = p_1 p_2 p_3 \ldots$ como uma sequência infinita de algarismos aleatórios, selecionada a partir de {0,1,2,3,4,5, 6.7.7.8,9} com igual probabilidade. -It can be seen that p corresponds to the real number 0.p1 p2 p3 .... +Pode-se ver que $p$ corresponde ao número real $0.p_1 p_2 p_3 \ldots$. -It can also be seen that choosing a random real number from the interval \[0,1) is equivalent to choosing an infinite sequence of random digits selected from {0,1,2,3,4,5,6,7,8,9} with equal probability. +Também pode-se ver que escolher um número aleatório real no intervalo [0, 1) equivale a escolher uma sequência infinita de algarismos aleatórios selecionados a partir de {0,1, 2, 3,4,5, 6,7,8,9} com igual probabilidade. -For any positive integer n with d decimal digits, let k be the smallest index such that pk, pk+1, ...pk+d-1 are the decimal digits of n, in the same order. Also, let g(n) be the expected value of k; it can be proven that g(n) is always finite and, interestingly, always an integer number. +Para qualquer número inteiro positivo $n$ com $d$ algarismos decimais, considere $k$ como o menor índice de tal forma que $p_k, p_{k + 1}, \ldots p_{k + d - 1}$ são os algarismos decimais de $n$, na mesma ordem. -For example, if n = 535, then for p = 31415926535897...., we get k = 9 for p = 355287143650049560000490848764084685354..., we get k = 36 etc and we find that g(535) = 1008. +Além disso, considere $g(n)$ como o valor esperado de $k$; pode-se provar que $g(n)$ é sempre finito e, curiosamente, sempre um número inteiro. -Given that , find +Por exemplo, se $n = 535$, então -Note: represents the floor function. +para $p = 31415926\mathbf{535}897\ldots$, temos que $k = 9$ + +para $p = 35528714365004956000049084876408468\mathbf{535}4\ldots$, temos que $k = 36$ + +etc. e vemos que $g(535) = 1008$. + +Dado que $\displaystyle\sum_{n = 2}^{999} g\left(\left\lfloor\frac{{10}^6}{n}\right\rfloor\right) = 27280188$, find $\displaystyle\sum_{n = 2}^{999.999} g\left(\left\lfloor\frac{{10}^{16}}{n}\right\rfloor\right)$. + +**Observação:** $\lfloor x\rfloor$ representa a função de base. # --hints-- -`euler316()` should return 542934735751917760. +`numbersInDecimalExpansion()` deve retornar `542934735751917760`. ```js -assert.strictEqual(euler316(), 542934735751917760); +assert.strictEqual(numbersInDecimalExpansion(), 542934735751917760); ``` # --seed-- @@ -35,12 +43,12 @@ assert.strictEqual(euler316(), 542934735751917760); ## --seed-contents-- ```js -function euler316() { +function numbersInDecimalExpansion() { return true; } -euler316(); +numbersInDecimalExpansion(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-317-firecracker.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-317-firecracker.md index bb528a225a..53d1b7aed5 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-317-firecracker.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-317-firecracker.md @@ -1,6 +1,6 @@ --- id: 5900f4aa1000cf542c50ffbc -title: 'Problem 317: Firecracker' +title: 'Problema 317: Fogos de artifício' challengeType: 5 forumTopicId: 301973 dashedName: problem-317-firecracker @@ -8,18 +8,18 @@ dashedName: problem-317-firecracker # --description-- -A firecracker explodes at a height of 100 m above level ground. It breaks into a large number of very small fragments, which move in every direction; all of them have the same initial velocity of 20 m/s. +Um fogo de artifício explode a uma altura de 100 m acima do solo. Ele explode em um grande número de fragmentos muito pequenos, que se movem em todas as direções; todos eles têm a mesma velocidade inicial de 20 $\frac{\text{m}}{\text{s}}$. -We assume that the fragments move without air resistance, in a uniform gravitational field with g=9.81 m/s2. +Assumimos que os fragmentos se movem sem resistência do ar, em um campo gravitacional uniforme com $g=9,81 \frac{\text{m}}{\text{s}^2}$. -Find the volume (in m3) of the region through which the fragments move before reaching the ground. Give your answer rounded to four decimal places. +Encontre o volume (em $\text{m}^3$) da região através da qual os fragmentos se movem antes de chegar ao chão. Dê sua resposta arredondada para quatro casas decimais. # --hints-- -`euler317()` should return 1856532.8455. +`firecracker()` deve retornar `1856532.8455`. ```js -assert.strictEqual(euler317(), 1856532.8455); +assert.strictEqual(firecracker(), 1856532.8455); ``` # --seed-- @@ -27,12 +27,12 @@ assert.strictEqual(euler317(), 1856532.8455); ## --seed-contents-- ```js -function euler317() { +function firecracker() { return true; } -euler317(); +firecracker(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-318-2011-nines.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-318-2011-nines.md index 1e8e9b8821..7fed0ec8d2 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-318-2011-nines.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-318-2011-nines.md @@ -1,6 +1,6 @@ --- id: 5900f4ab1000cf542c50ffbd -title: 'Problem 318: 2011 nines' +title: 'Problema 318: 2011 noves' challengeType: 5 forumTopicId: 301974 dashedName: problem-318-2011-nines @@ -8,44 +8,28 @@ dashedName: problem-318-2011-nines # --description-- -Consider the real number √2+√3. +Considere o número real $\sqrt{2} + \sqrt{3}$. -When we calculate the even powers of √2+√3 +Quando calculamos as potências pares de $\sqrt{2} + \sqrt{3}$ obtemos: -we get: +$$\begin{align} & {(\sqrt{2} + \sqrt{3})}^2 = 9.898979485566356\ldots \\\\ & {(\sqrt{2} + \sqrt{3})}^4 = 97.98979485566356\ldots \\\\ & {(\sqrt{2} + \sqrt{3})}^6 = 969.998969071069263\ldots \\\\ & {(\sqrt{2} + \sqrt{3})}^8 = 9601.99989585502907\ldots \\\\ & {(\sqrt{2} + \sqrt{3})}^{10} = 95049.999989479221\ldots \\\\ & {(\sqrt{2} + \sqrt{3})}^{12} = 940897.9999989371855\ldots \\\\ & {(\sqrt{2} + \sqrt{3})}^{14} = 9313929.99999989263\ldots \\\\ & {(\sqrt{2} + \sqrt{3})}^{16} = 92198401.99999998915\ldots \\\\ \end{align}$$ -(√2+√3)2 = 9.898979485566356... +Parece que o número de noves consecutivos no início da parte fracionária dessas potências não diminui. Na verdade, pode ser provado que a parte fracionária de ${(\sqrt{2} + \sqrt{3})}^{2n}$ aproxima-se de 1 para $n$ grandes. -(√2+√3)4 = 97.98979485566356... +Considere todos os números reais da forma $\sqrt{p} + \sqrt{q}$ com $p$ e $q$ números inteiros positivos e $p < q$, tal que a parte fracionária de ${(\sqrt{p} + \sqrt{q})}^{2n}$ se aproxima de 1 para $n$ grandes. -(√2+√3)6 = 969.998969071069263... +Considere $C(p,q,n)$ como o número de noves consecutivos no início da parte fracionária de ${(\sqrt{p} + \sqrt{q})}^{2n}$. -(√2+√3)8 = 9601.99989585502907... +Considere $N(p,q)$ como o valor mínimo de $n$, tal que $C(p,q,n) ≥ 2011$. -(√2+√3)10 = 95049.999989479221... - -(√2+√3)12 = 940897.9999989371855... - -(√2+√3)14 = 9313929.99999989263... - -(√2+√3)16 = 92198401.99999998915... - -It looks like that the number of consecutive nines at the beginning of the fractional part of these powers is non-decreasing. In fact it can be proven that the fractional part of (√2+√3)2n approaches 1 for large n. - -Consider all real numbers of the form √p+√q with p and q positive integers and p<q, such that the fractional part of (√p+√q)2n approaches 1 for large n. - -Let C(p,q,n) be the number of consecutive nines at the beginning of the fractional part of (√p+√q)2n. - -Let N(p,q) be the minimal value of n such that C(p,q,n) ≥ 2011. - -Find ∑N(p,q) for p+q ≤ 2011. +Encontre $\sum N(p,q)$ para $p + q ≤ 2011$. # --hints-- -`euler318()` should return 709313889. +`twoThousandElevenNines()` deve retornar `709313889`. ```js -assert.strictEqual(euler318(), 709313889); +assert.strictEqual(twoThousandElevenNines(), 709313889); ``` # --seed-- @@ -53,12 +37,12 @@ assert.strictEqual(euler318(), 709313889); ## --seed-contents-- ```js -function euler318() { +function twoThousandElevenNines() { return true; } -euler318(); +twoThousandElevenNines(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-319-bounded-sequences.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-319-bounded-sequences.md index 687eeb26cd..75873bb3db 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-319-bounded-sequences.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-319-bounded-sequences.md @@ -1,6 +1,6 @@ --- id: 5900f4ab1000cf542c50ffbe -title: 'Problem 319: Bounded Sequences' +title: 'Problema 319: Sequências limitadas' challengeType: 5 forumTopicId: 301975 dashedName: problem-319-bounded-sequences @@ -8,26 +8,24 @@ dashedName: problem-319-bounded-sequences # --description-- -Let x1, x2,..., xn be a sequence of length n such that: +Considere $x_1, x_2, \ldots, x_n$ como uma sequência de comprimento $n$ para que: -x1 = 2 +- $x_1 = 2$ +- para todos os $1 < i ≤ n : x_{i - 1} < x_i$ +- para todos os $i$ e $j$ com $1 ≤ i, j ≤ n : {(x_i)}^j < {(x_j + 1)}^i$ -for all 1 < i ≤ n : xi-1 < xi +Há apenas cinco sequências de comprimento 2. Sejam elas: {2,4}, {2,5}, {2,6}, {2,7} e {2,8}. Há 293 sequências de comprimento 5. Três exemplos são dados abaixo: {2,5,11,25,55}, {2,6,14,36,88}, {2,8,22,64,181}. -for all i and j with 1 ≤ i, j ≤ n : (xi) j < (xj + 1)i +Considere que $t(n)$ indica o número de tais sequências de comprimento $n$. Você é informado de que $t(10) = 86195$ e $t(20) = 5227991891$. -There are only five such sequences of length 2, namely: {2,4}, {2,5}, {2,6}, {2,7} and {2,8}. There are 293 such sequences of length 5; three examples are given below: {2,5,11,25,55}, {2,6,14,36,88}, {2,8,22,64,181}. - -Let t(n) denote the number of such sequences of length n. You are given that t(10) = 86195 and t(20) = 5227991891. - -Find t(1010) and give your answer modulo 109. +Encontre $t({10}^{10})$ e dê sua resposta modulo $10^9$. # --hints-- -`euler319()` should return 268457129. +`boundedSequences()` deve retornar `268457129`. ```js -assert.strictEqual(euler319(), 268457129); +assert.strictEqual(boundedSequences(), 268457129); ``` # --seed-- @@ -35,12 +33,12 @@ assert.strictEqual(euler319(), 268457129); ## --seed-contents-- ```js -function euler319() { +function boundedSequences() { return true; } -euler319(); +boundedSequences(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-320-factorials-divisible-by-a-huge-integer.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-320-factorials-divisible-by-a-huge-integer.md index 5171172f98..10c56bd1be 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-320-factorials-divisible-by-a-huge-integer.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-320-factorials-divisible-by-a-huge-integer.md @@ -1,6 +1,6 @@ --- id: 5900f4ae1000cf542c50ffbf -title: 'Problem 320: Factorials divisible by a huge integer' +title: 'Problema 320: Fatoriais divisíveis por um número inteiro muito grande' challengeType: 5 forumTopicId: 301977 dashedName: problem-320-factorials-divisible-by-a-huge-integer @@ -8,20 +8,20 @@ dashedName: problem-320-factorials-divisible-by-a-huge-integer # --description-- -Let N(i) be the smallest integer n such that n! is divisible by (i!)1234567890 +Considere $N(i)$ como o menor número inteiro $n$, tal que $n!$ é divisível por $(i!)^{1234567890}$ -Let S(u)=∑N(i) for 10 ≤ i ≤ u. +Considere $S(u) = \sum N(i)$ para $10 ≤ i ≤ u$. -S(1000)=614538266565663. +$S(1000)=614.538.266.565.663$. -Find S(1 000 000) mod 1018. +Encontre $S(1.000.000)\bmod {10}^{18}$. # --hints-- -`euler320()` should return 278157919195482660. +`divisibleByHugeInteger()` deve retornar `278157919195482660`. ```js -assert.strictEqual(euler320(), 278157919195482660); +assert.strictEqual(divisibleByHugeInteger(), 278157919195482660); ``` # --seed-- @@ -29,12 +29,12 @@ assert.strictEqual(euler320(), 278157919195482660); ## --seed-contents-- ```js -function euler320() { +function divisibleByHugeInteger() { return true; } -euler320(); +divisibleByHugeInteger(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-321-swapping-counters.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-321-swapping-counters.md index 34e52a4dea..65d7273a22 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-321-swapping-counters.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-321-swapping-counters.md @@ -1,6 +1,6 @@ --- id: 5900f4ae1000cf542c50ffc0 -title: 'Problem 321: Swapping Counters' +title: 'Problema 321: Trocando contadores' challengeType: 5 forumTopicId: 301978 dashedName: problem-321-swapping-counters @@ -8,22 +8,28 @@ dashedName: problem-321-swapping-counters # --description-- -A horizontal row comprising of 2n + 1 squares has n red counters placed at one end and n blue counters at the other end, being separated by a single empty square in the centre. For example, when n = 3. +Uma linha horizontal que compreende $2n + 1$ quadrados tem $n$ contadores vermelhos colocados em uma extremidade e $n$ contadores azuis na outra extremidade, estando separados por um único quadrado vazio no centro. Por exemplo, para $n = 3$. -A counter can move from one square to the next (slide) or can jump over another counter (hop) as long as the square next to that counter is unoccupied. +três quadrados com contadores vermelhos e azuis colocados em pontas opostas da linha, separados por um quadrado vazio -Let M(n) represent the minimum number of moves/actions to completely reverse the positions of the coloured counters; that is, move all the red counters to the right and all the blue counters to the left. It can be verified M(3) = 15, which also happens to be a triangle number. +Um contador pode se mover de um quadrado para o próximo (deslizando) ou pular sobre outro contador (salto) desde que o quadrado ao lado desse contador esteja desocupado. -If we create a sequence based on the values of n for which M(n) is a triangle number then the first five terms would be: 1, 3, 10, 22, and 63, and their sum would be 99. +movimentos permitidos do contador -Find the sum of the first forty terms of this sequence. +Considere $M(n)$ como representando o número mínimo de movimentos/ações para reverter completamente as posições dos contadores coloridos; ou seja, mover todos os contadores vermelhos para a direita e todos os contadores azuis para a esquerda. + +Pode-se verificar que $M(3) = 15$, que também é um número triangular. + +Se criarmos uma sequência baseada nos valores de n para os quais $M(n)$ é um número triangular, então os primeiros cinco termos seriam: 1, 3, 10, 22, e 63, e sua soma seria 99. + +Encontre a soma dos primeiros quarenta termos desta sequência. # --hints-- -`euler321()` should return 2470433131948040. +`swappingCounters()` deve retornar `2470433131948040`. ```js -assert.strictEqual(euler321(), 2470433131948040); +assert.strictEqual(swappingCounters(), 2470433131948040); ``` # --seed-- @@ -31,12 +37,12 @@ assert.strictEqual(euler321(), 2470433131948040); ## --seed-contents-- ```js -function euler321() { +function swappingCounters() { return true; } -euler321(); +swappingCounters(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-322-binomial-coefficients-divisible-by-10.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-322-binomial-coefficients-divisible-by-10.md index 241c3a74f0..c83a7c33e2 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-322-binomial-coefficients-divisible-by-10.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-322-binomial-coefficients-divisible-by-10.md @@ -1,6 +1,6 @@ --- id: 5900f4af1000cf542c50ffc1 -title: 'Problem 322: Binomial coefficients divisible by 10' +title: 'Problema 322: Coeficientes binomiais divisíveis por 10' challengeType: 5 forumTopicId: 301979 dashedName: problem-322-binomial-coefficients-divisible-by-10 @@ -8,18 +8,18 @@ dashedName: problem-322-binomial-coefficients-divisible-by-10 # --description-- -Let T(m, n) be the number of the binomial coefficients iCn that are divisible by 10 for n ≤ i < m(i, m and n are positive integers). +Considere $T(m, n)$ como o número de coeficientes binomiais ${}^iC_n$ que são divisíveis por 10 para $n ≤ i < m$ ($i$, $m$ e $n$ são números inteiros positivos). -You are given that T(109, 107-10) = 989697000. +Você é informado de que $T({10}^9, {10}^7 - 10) = 989.697.000$. -Find T(1018, 1012-10). +Encontre $T({10}^{18}, {10}^{12} - 10)$. # --hints-- -`euler322()` should return 999998760323314000. +`binomialCoefficientsDivisibleBy10()` deve retornar `999998760323314000`. ```js -assert.strictEqual(euler322(), 999998760323314000); +assert.strictEqual(binomialCoefficientsDivisibleBy10(), 999998760323314000); ``` # --seed-- @@ -27,12 +27,12 @@ assert.strictEqual(euler322(), 999998760323314000); ## --seed-contents-- ```js -function euler322() { +function binomialCoefficientsDivisibleBy10() { return true; } -euler322(); +binomialCoefficientsDivisibleBy10(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-323-bitwise-or-operations-on-random-integers.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-323-bitwise-or-operations-on-random-integers.md index b336759562..da70be9b06 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-323-bitwise-or-operations-on-random-integers.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-323-bitwise-or-operations-on-random-integers.md @@ -1,6 +1,6 @@ --- id: 5900f4b01000cf542c50ffc2 -title: 'Problem 323: Bitwise-OR operations on random integers' +title: 'Problema 323: Operações bitwise-OR em números inteiros aleatórios' challengeType: 5 forumTopicId: 301980 dashedName: problem-323-bitwise-or-operations-on-random-integers @@ -8,24 +8,25 @@ dashedName: problem-323-bitwise-or-operations-on-random-integers # --description-- -Let y0, y1, y2,... be a sequence of random unsigned 32 bit integers +Considere $y_0, y_1, y_2, \ldots$ como uma sequência aleatória de números inteiros de 32 bits sem sinal -(i.e. 0 ≤ yi < 232, every value equally likely). +(ou seja, $0 ≤ y_i < 2^{32}$, sendo cada valor igualmente possível). -For the sequence xi the following recursion is given:x0 = 0 and +Para a sequência $x_i$ é dada a seguinte recursão: -xi = xi-1| yi-1, for i > 0. ( | is the bitwise-OR operator) +- $x_0 = 0$ e +- $x_i = x_{i - 1} \mathbf{|} y_{i - 1}$, para $i > 0$. ($\mathbf{|}$ é a operação bitwise-OR) -It can be seen that eventually there will be an index N such that xi = 232 -1 (a bit-pattern of all ones) for all i ≥ N. +Pode-se ver que, eventualmente, haverá um índice $N$, tal que $x_i = 2^{32} - 1$ (um padrão de bits somente composto de 1s) para todos $i ≥ N$. -Find the expected value of N. Give your answer rounded to 10 digits after the decimal point. +Encontre o valor esperado de $N$. Dê sua resposta arredondada para 10 algarismos após o ponto (10 casas depois da vírgula). # --hints-- -`euler323()` should return 6.3551758451. +`bitwiseOrOnRandomIntegers()` deve retornar `6.3551758451`. ```js -assert.strictEqual(euler323(), 6.3551758451); +assert.strictEqual(bitwiseOrOnRandomIntegers(), 6.3551758451); ``` # --seed-- @@ -33,12 +34,12 @@ assert.strictEqual(euler323(), 6.3551758451); ## --seed-contents-- ```js -function euler323() { +function bitwiseOrOnRandomIntegers() { return true; } -euler323(); +bitwiseOrOnRandomIntegers(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-324-building-a-tower.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-324-building-a-tower.md index 66ce491477..50afc3121a 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-324-building-a-tower.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-324-building-a-tower.md @@ -1,6 +1,6 @@ --- id: 5900f4b11000cf542c50ffc3 -title: 'Problem 324: Building a tower' +title: 'Problema 324: Construção de uma torre' challengeType: 5 forumTopicId: 301981 dashedName: problem-324-building-a-tower @@ -8,18 +8,20 @@ dashedName: problem-324-building-a-tower # --description-- -Let f(n) represent the number of ways one can fill a 3×3×n tower with blocks of 2×1×1. You're allowed to rotate the blocks in any way you like; however, rotations, reflections etc of the tower itself are counted as distinct. +Considere $f(n)$ como o número de maneiras que se pode preencher uma torre $3×3×n$ com blocos de $2×1×1$. Você tem permissão para girar os blocos da forma que quiser; no entanto, as rotações, reflexões etc. da própria torre serão contadas como distintas. -For example (with q = 100000007) :f(2) = 229,f(4) = 117805,f(10) mod q = 96149360,f(103) mod q = 24806056,f(106) mod q = 30808124. +Por exemplo (com $q = 100.000.007$): -Find f(1010000) mod 100000007. +$$\begin{align} & f(2) = 229, \\\\ & f(4) = 117.805, \\\\ & f(10)\bmod q = 96.149.360, \\\\ & f({10}^3)\bmod q = 24.806.056, \\\\ & f({10}^6)\bmod q = 30.808.124. \end{align}$$ + +Encontre $f({10}^{10000})\bmod 100.000.007$. # --hints-- -`euler324()` should return 96972774. +`buildingTower()` deve retornar `96972774`. ```js -assert.strictEqual(euler324(), 96972774); +assert.strictEqual(buildingTower(), 96972774); ``` # --seed-- @@ -27,12 +29,12 @@ assert.strictEqual(euler324(), 96972774); ## --seed-contents-- ```js -function euler324() { +function buildingTower() { return true; } -euler324(); +buildingTower(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-325-stone-game-ii.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-325-stone-game-ii.md index 6d0389b9fa..0834eb30c4 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-325-stone-game-ii.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-325-stone-game-ii.md @@ -1,6 +1,6 @@ --- id: 5900f4b11000cf542c50ffc4 -title: 'Problem 325: Stone Game II' +title: 'Problema 325: Jogo da pedra II' challengeType: 5 forumTopicId: 301982 dashedName: problem-325-stone-game-ii @@ -8,26 +8,26 @@ dashedName: problem-325-stone-game-ii # --description-- -A game is played with two piles of stones and two players. At her turn, a player removes a number of stones from the larger pile. The number of stones she removes must be a positive multiple of the number of stones in the smaller pile. +Uma partida é jogada com duas pilhas de pedras e dois jogadores. No turno de cada jogador, ele pode remover um número de pedras da pilha maior. O número de pedras removidas deve ser um múltiplo positivo do número de pedras na pilha menor. -E.g., let the ordered pair(6,14) describe a configuration with 6 stones in the smaller pile and 14 stones in the larger pile, then the first player can remove 6 or 12 stones from the larger pile. +Exemplo: considere o par ordenado (6,14) como capaz de descrever uma configuração com 6 pedras na pilha menor e 14 pedras na pilha maior. Então, o primeiro jogador pode remover 6 ou 12 pedras da pilha maior. -The player taking all the stones from a pile wins the game. +O jogador que pegar todas as pedras de uma pilha ganha o jogo. -A winning configuration is one where the first player can force a win. For example, (1,5), (2,6) and (3,12) are winning configurations because the first player can immediately remove all stones in the second pile. +Uma configuração vencedora é aquela onde o primeiro jogador pode forçar uma vitória. Por exemplo, (1,5), (2,6) e (3,12) são configurações vencedores porque o primeiro jogador pode remover imediatamente todas as pedras na segunda pilha. -A losing configuration is one where the second player can force a win, no matter what the first player does. For example, (2,3) and (3,4) are losing configurations: any legal move leaves a winning configuration for the second player. +Uma configuração perdedora é aquela onde o segundo jogador pode forçar uma vitória, não importando o que o primeiro jogador faça. Por exemplo, (2,3) e (3,4) são configurações perdedoras: qualquer movimento legal deixa uma configuração vencedora para o segundo jogador. -Define S(N) as the sum of (xi+yi) for all losing configurations (xi,yi), 0 < xi < yi ≤ N. We can verify that S(10) = 211 and S(104) = 230312207313. +Defina $S(N)$ como a soma de ($x_i + y_i$) para todas as configurações perdedoras ($x_i$, $y_i$), $0 < x_i < y_i ≤ N$. Podemos verificar que $S(10) = 211$ e $S({10}^4) = 230.312.207.313$. -Find S(1016) mod 710. +Encontre $S({10}^{16})\bmod 7^{10}$. # --hints-- -`euler325()` should return 54672965. +`stoneGameTwo()` deve retornar `54672965`. ```js -assert.strictEqual(euler325(), 54672965); +assert.strictEqual(stoneGameTwo(), 54672965); ``` # --seed-- @@ -35,12 +35,12 @@ assert.strictEqual(euler325(), 54672965); ## --seed-contents-- ```js -function euler325() { +function stoneGameTwo() { return true; } -euler325(); +stoneGameTwo(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-326-modulo-summations.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-326-modulo-summations.md index 1e6b648d9a..ed61d24732 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-326-modulo-summations.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-326-modulo-summations.md @@ -1,6 +1,6 @@ --- id: 5900f4b21000cf542c50ffc5 -title: 'Problem 326: Modulo Summations' +title: 'Problema 326: Somas de módulos' challengeType: 5 forumTopicId: 301983 dashedName: problem-326-modulo-summations @@ -8,24 +8,26 @@ dashedName: problem-326-modulo-summations # --description-- -Let an be a sequence recursively defined by: . +Considere an como sendo uma sequência recursivamente definida por: $a_1 = 1$, $\displaystyle a_n = \left(\sum_{k = 1}^{n - 1} k \times a_k\right)\bmod n$. -So the first 10 elements of an are: 1,1,0,3,0,3,5,4,1,9. +Portanto, os primeiros 10 elementos de $a_n$ são: 1, 1, 0, 3, 0, 3, 5, 4, 1, 9. -Let f(N,M) represent the number of pairs (p,q) such that: +Considere $f(N, M)$ como representando o número de pares $(p, q)$, de modo que: -It can be seen that f(10,10)=4 with the pairs (3,3), (5,5), (7,9) and (9,10). +$$ 1 \le p \le q \le N \\; \text{e} \\; \left(\sum_{i = p}^q a_i\right)\bmod M = 0$$ -You are also given that f(104,103)=97158. +Pode-se ver que $f(10, 10) = 4$ com os pares (3,3), (5,5), (7,9) e (9,10). -Find f(1012,106). +Você também é informado de que $f({10}^4, {10}^3) = 97.158$. + +Encontre $f({10}^{12}, {10}^6)$. # --hints-- -`euler326()` should return 1966666166408794400. +`moduloSummations()` deve retornar `1966666166408794400`. ```js -assert.strictEqual(euler326(), 1966666166408794400); +assert.strictEqual(moduloSummations(), 1966666166408794400); ``` # --seed-- @@ -33,12 +35,12 @@ assert.strictEqual(euler326(), 1966666166408794400); ## --seed-contents-- ```js -function euler326() { +function moduloSummations() { return true; } -euler326(); +moduloSummations(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-327-rooms-of-doom.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-327-rooms-of-doom.md index 354596b1d7..5c5506f738 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-327-rooms-of-doom.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-327-rooms-of-doom.md @@ -1,6 +1,6 @@ --- id: 5900f4b31000cf542c50ffc6 -title: 'Problem 327: Rooms of Doom' +title: 'Problema 327: Salas da destruição' challengeType: 5 forumTopicId: 301984 dashedName: problem-327-rooms-of-doom @@ -8,30 +8,38 @@ dashedName: problem-327-rooms-of-doom # --description-- -A series of three rooms are connected to each other by automatic doors. +Uma série de três salas está interligada por portas automáticas. -Each door is operated by a security card. Once you enter a room the door automatically closes and that security card cannot be used again. A machine at the start will dispense an unlimited number of cards, but each room (including the starting room) contains scanners and if they detect that you are holding more than three security cards or if they detect an unattended security card on the floor, then all the doors will become permanently locked. However, each room contains a box where you may safely store any number of security cards for use at a later stage. +série de três salas interligada por portas automáticas -If you simply tried to travel through the rooms one at a time then as you entered room 3 you would have used all three cards and would be trapped in that room forever! +Cada porta é operada por um cartão de segurança. Ao entrar em uma sala, a porta fecha automaticamente e esse cartão de segurança não poderá ser usado novamente. Uma máquina vai dispensar um número ilimitado de cartões no início, mas cada sala (incluindo a sala inicial) contém scanners. Caso eles detectem que você está segurando mais de três cartões de segurança ou caso eles detectem um cartão de segurança solto no chão, todas as portas ficarão permanentemente trancadas. No entanto, cada sala contém uma caixa onde você pode armazenar com segurança qualquer número de cartões de segurança para uso em uma fase posterior. -However, if you make use of the storage boxes, then escape is possible. For example, you could enter room 1 using your first card, place one card in the storage box, and use your third card to exit the room back to the start. Then after collecting three more cards from the dispensing machine you could use one to enter room 1 and collect the card you placed in the box a moment ago. You now have three cards again and will be able to travel through the remaining three doors. This method allows you to travel through all three rooms using six security cards in total. +Se simplesmente tentássemos atravessar a sala uma por vez, quando entrássemos na sala 3, teríamos usado todos os três cartões e ficaríamos presos para sempre! -It is possible to travel through six rooms using a total of 123 security cards while carrying a maximum of 3 cards. +No entanto, se utilizarmos as caixas de armazenamento, é possível escapar. Por exemplo, você pode entrar na sala 1 usando seu primeiro cartão, colocar um cartão na caixa de armazenamento, e usar seu terceiro cartão para sair da sala de volta ao início. Então, depois de coletar mais três cartões da máquina de dispensar, você poderia usar um para entrar na sala 1 e coletar o cartão que você colocou na caixa há alguns instantes. Você tem agora três cartões novamente e poderá passar pelas três portas que restam. Esse método permite que você viaje através de todas as três salas usando seis cartões de segurança no total. -Let C be the maximum number of cards which can be carried at any time. Let R be the number of rooms to travel through. Let M(C,R) be the minimum number of cards required from the dispensing machine to travel through R rooms carrying up to a maximum of C cards at any time. +É possível viajar através de seis salas utilizando um total de 123 cartões de segurança, enquanto se carrega um máximo de 3 cartões. -For example, M(3,6)=123 and M(4,6)=23.And, ΣM(C,6)=146 for 3 ≤ C ≤ 4. +Considere $C$ como o número máximo de cartões que podem ser transportados a qualquer momento. -You are given that ΣM(C,10)=10382 for 3 ≤ C ≤ 10. +Considere $R$ como o número de salas a percorrer. -Find ΣM(C,30) for 3 ≤ C ≤ 40. +Considere $M(C, R)$ como o número mínimo de cartões necessários da máquina de dispensa de cartões para viajar $R$ salas carregando até um máximo de $C$ cartões a qualquer momento. + +Por exemplo, $M(3, 6) = 123$ e $M(4, 6) = 23$. + +E $\sum M(C, 6) = 146$ para $3 ≤ C ≤ 4$. + +Você é informado que $\sum M(C, 10) = 10382$ para $3 ≤ C ≤ 10$. + +Encontre $\sum M(C, 30)$ para $3 ≤ C ≤ 40$. # --hints-- -`euler327()` should return 34315549139516. +`roomsOfDoom()` deve retornar `34315549139516`. ```js -assert.strictEqual(euler327(), 34315549139516); +assert.strictEqual(roomsOfDoom(), 34315549139516); ``` # --seed-- @@ -39,12 +47,12 @@ assert.strictEqual(euler327(), 34315549139516); ## --seed-contents-- ```js -function euler327() { +function roomsOfDoom() { return true; } -euler327(); +roomsOfDoom(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-328-lowest-cost-search.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-328-lowest-cost-search.md index 4a00f455cc..46c55b0057 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-328-lowest-cost-search.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-328-lowest-cost-search.md @@ -1,6 +1,6 @@ --- id: 5900f4b41000cf542c50ffc7 -title: 'Problem 328: Lowest-cost Search' +title: 'Problema 328: Pesquisa pelo menor custo' challengeType: 5 forumTopicId: 301985 dashedName: problem-328-lowest-cost-search @@ -8,32 +8,32 @@ dashedName: problem-328-lowest-cost-search # --description-- -We are trying to find a hidden number selected from the set of integers {1, 2, ..., n} by asking questions. +Estamos tentando encontrar um número oculto selecionado de um conjunto de números inteiros {1, 2, ..., $n$} fazendo perguntas. Cada número (pergunta) que perguntamos, tem um custo igual ao número solicitado e nós recebemos uma de três respostas possíveis: -Each number (question) we ask, has a cost equal to the number asked and we get one of three possible answers: "Your guess is lower than the hidden number", or +- "Seu palpite é menor que o número oculto", ou +- "Sim, é isso!", ou +- "Seu palpite é maior que o número oculto". -"Yes, that's it!", or +Dado o valor de $n$, uma estratégia ideal minimiza o custo total (ou seja, a soma de todas as perguntas feitas) para o pior caso possível. Ex: -"Your guess is higher than the hidden number". +Se $n = 3$, o melhor que podemos fazer é obviamente perguntar o número "2". A resposta nos levará imediatamente a encontrar o número oculto (a um custo total de 2). -Given the value of n, an optimal strategy minimizes the total cost (i.e. the sum of all the questions asked) for the worst possible case. E.g. +Se $n = 8$, nós podemos decidir usar um tipo de estratégia com "busca binária": nossa primeira questão seria "4" e se o número oculto for maior que 4, precisaremos de uma ou duas questões adicionais. Considere que nossa segunda pergunta seja "6". Se o número oculto ainda for superior a 6, necessitaremos de uma terceira pergunta para discriminar entre 7 e 8. Assim, nossa terceira pergunta será "7" e o custo total para este cenário pior, será $4 + 6 + 7 = \mathbf{\color{red}{17}}$. -If n=3, the best we can do is obviously to ask the number "2". The answer will immediately lead us to find the hidden number (at a total cost = 2). +Podemos melhorar consideravelmente o pior custo para $n = 8$, tendo "5" como nossa primeira pergunta. Se nos disserem que o número oculto é maior que 5, a nossa segunda pergunta será "7", então saberemos com certeza qual é o número oculto (para um custo total de $5 + 7 = \mathbf{\color{blue}{12}}$). Se nos disserem que o número oculto é menor que 5, nossa segunda pergunta será "3". Se for menor que 3, nossa terceira pergunta será "1", dando um custo total de $5 + 3 + 1 = \mathbf{\color{blue}{9}}$. Como $\mathbf{\color{blue}{12 > 9}}$, o pior caso de custo para esta estratégia é 12. Isso é melhor do que o que alcançamos anteriormente com a estratégia de "pesquisa binária"; também é melhor ou igual a qualquer outra estratégia. Então, de fato, acabamos de descrever uma estratégia ideal para $n = 8$. -If n=8, we might decide to use a "binary search" type of strategy: Our first question would be "4" and if the hidden number is higher than 4 we will need one or two additional questions. Let our second question be "6". If the hidden number is still higher than 6, we will need a third question in order to discriminate between 7 and 8. Thus, our third question will be "7" and the total cost for this worst-case scenario will be 4+6+7=17. +Considere $C(n)$ como o pior caso de custo alcançado com uma estratégia ideal para $n$, como descrito acima. Assim, $C(1) = 0$, $C(2) = 1$, $C(3) = 2$ e $C(8) = 12$. -We can improve considerably the worst-case cost for n=8, by asking "5" as our first question. If we are told that the hidden number is higher than 5, our second question will be "7", then we'll know for certain what the hidden number is (for a total cost of 5+7=12). If we are told that the hidden number is lower than 5, our second question will be "3" and if the hidden number is lower than 3 our third question will be "1", giving a total cost of 5+3+1=9. Since 12>9, the worst-case cost for this strategy is 12. That's better than what we achieved previously with the "binary search" strategy; it is also better than or equal to any other strategy. So, in fact, we have just described an optimal strategy for n=8. +Da mesma forma, $C(100) = 400$ e $\displaystyle\sum_{n = 1}^{100} C(n) = 17575$. -Let C(n) be the worst-case cost achieved by an optimal strategy for n, as described above. Thus C(1) = 0, C(2) = 1, C(3) = 2 and C(8) = 12. Similarly, C(100) = 400 and C(n) = 17575. - -Find C(n). +Encontre $\displaystyle\sum_{n = 1}^{200.000} C(n)$. # --hints-- -`euler328()` should return 260511850222. +`lowestCostSearch()` deve retornar `260511850222`. ```js -assert.strictEqual(euler328(), 260511850222); +assert.strictEqual(lowestCostSearch(), 260511850222); ``` # --seed-- @@ -41,12 +41,12 @@ assert.strictEqual(euler328(), 260511850222); ## --seed-contents-- ```js -function euler328() { +function lowestCostSearch() { return true; } -euler328(); +lowestCostSearch(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-329-prime-frog.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-329-prime-frog.md index 6b1e185daf..64dc8e1b80 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-329-prime-frog.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-329-prime-frog.md @@ -1,6 +1,6 @@ --- id: 5900f4b51000cf542c50ffc8 -title: 'Problem 329: Prime Frog' +title: 'Problema 329: Sapo primo' challengeType: 5 forumTopicId: 301986 dashedName: problem-329-prime-frog @@ -8,24 +8,30 @@ dashedName: problem-329-prime-frog # --description-- -Susan has a prime frog. +Susan tem um sapo primo. -Her frog is jumping around over 500 squares numbered 1 to 500. +Seu sapo está pulando por mais de 500 quadrados numerados de 1 a 500. -He can only jump one square to the left or to the right, with equal probability, and he cannot jump outside the range \[1;500].(if it lands at either end, it automatically jumps to the only available square on the next move.) +Ele só pode pular um quadrado para a esquerda ou para a direita, com igual probabilidade, e não pode pular fora do intervalo [1;500]. Se ele cair em qualquer uma das extremidades, ele pula automaticamente para o único quadrado disponível na próxima vez. -When he is on a square with a prime number on it, he croaks 'P' (PRIME) with probability 2/3 or 'N' (NOT PRIME) with probability 1/3 just before jumping to the next square. When he is on a square with a number on it that is not a prime he croaks 'P' with probability 1/3 or 'N' with probability 2/3 just before jumping to the next square. +Quando ele está em um quadrado que tem um número primo, ele coaxa 'P' (PRIMO) com probabilidade $\frac{2}{3}$ ou 'N' (NÃO PRIMO) com probabilidade $\frac{1}{3}$ antes de pular para o próximo quadrado. Quando ele está em um quadrado que tem um número não primo, ele coaxa 'P' com probabilidade $\frac{1}{3}$ ou 'N' com probabilidade $\frac{2}{3}$ antes de pular para o próximo quadrado. -Given that the frog's starting position is random with the same probability for every square, and given that she listens to his first 15 croaks, what is the probability that she hears the sequence PPPPNNPPPNPPNPN? +Dado que a posição inicial do sapo é aleatória com a mesma probabilidade para cada quadrado, e tendo em conta que Susan ouve seus primeiros 15 coaxos, qual é a probabilidade de ouvir a sequência PPPPNNPPPNPPNPN? -Give your answer as a fraction p/q in reduced form. +Dê sua resposta como uma string de uma fração `p/q` na forma reduzida. # --hints-- -`euler329()` should return 199740353 / 29386561536000. +`primeFrog()` deve retornar uma string. ```js -assert.strictEqual(euler329(), 199740353 / 29386561536000); +assert(typeof primeFrog() === 'string'); +``` + +`primeFrog()` deve retornar a string `199740353/29386561536000`. + +```js +assert.strictEqual(primeFrog(), '199740353/29386561536000'); ``` # --seed-- @@ -33,12 +39,12 @@ assert.strictEqual(euler329(), 199740353 / 29386561536000); ## --seed-contents-- ```js -function euler329() { +function primeFrog() { return true; } -euler329(); +primeFrog(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-330-eulers-number.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-330-eulers-number.md index c8a3feab39..4d74896f27 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-330-eulers-number.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-330-eulers-number.md @@ -1,6 +1,6 @@ --- id: 5900f4b71000cf542c50ffc9 -title: 'Problem 330: Euler''s Number' +title: 'Problema 330: Números de Euler' challengeType: 5 forumTopicId: 301988 dashedName: problem-330-eulers-number @@ -8,30 +8,28 @@ dashedName: problem-330-eulers-number # --description-- -An infinite sequence of real numbers a(n) is defined for all integers n as follows: +Uma sequência infinita de números reais $a(n)$ é definida para todos os números inteiros $n$ da seguinte forma: - +$$ a(n) = \begin{cases} 1 & n < 0 \\\\ \displaystyle \sum_{i = 1}^{\infty} \frac{a(n - 1)}{i!} & n \ge 0 \end{cases} $$ -For example,a(0) = 11! + 12! + 13! + ... = e − 1 a(1) = e − 11! + 12! + 13! + ... = 2e − 3 a(2) = 2e − 31! + e − 12! + 13! + ... = 72 e − 6 +Por exemplo: -with e = 2.7182818... being Euler's constant. +$$\begin{align} & a(0) = \frac{1}{1!} + \frac{1}{2!} + \frac{1}{3!} + \ldots = e − 1 \\\\ & a(1) = \frac{e − 1}{1!} + \frac{1}{2!} + \frac{1}{3!} + \ldots = 2e − 3 \\\\ & a(2) = \frac{2e − 3}{1!} + \frac{e − 1}{2!} + \frac{1}{3!} + \ldots = \frac{7}{2} e − 6 \end{align}$$ -It can be shown that a(n) is of the form +com $e = 2.7182818\ldots$ sendo a constante de Euler. -A(n) e + B(n)n! for integers A(n) and B(n). +Pode-se mostrar que $a(n)$ está no formato $\displaystyle\frac{A(n)e + B(n)}{n!}$ para os números inteiros $A(n)$ e $B(n)$. -For example a(10) = +Por exemplo, $\displaystyle a(10) = \frac{328161643e − 652694486}{10!}$. -328161643 e − 65269448610!. - -Find A(109) + B(109) and give your answer mod 77 777 777. +Encontre $A({10}^9)$ + $B({10}^9)$ e dê sua resposta $\bmod 77\\,777\\,777$. # --hints-- -`euler330()` should return 15955822. +`eulersNumber()` deve retornar `15955822`. ```js -assert.strictEqual(euler330(), 15955822); +assert.strictEqual(eulersNumber(), 15955822); ``` # --seed-- @@ -39,12 +37,12 @@ assert.strictEqual(euler330(), 15955822); ## --seed-contents-- ```js -function euler330() { +function eulersNumber() { return true; } -euler330(); +eulersNumber(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-331-cross-flips.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-331-cross-flips.md index 4d3d330a74..c4fe731c4b 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-331-cross-flips.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-331-cross-flips.md @@ -1,6 +1,6 @@ --- id: 5900f4b71000cf542c50ffca -title: 'Problem 331: Cross flips' +title: 'Problema 331: Viradas cruzadas' challengeType: 5 forumTopicId: 301989 dashedName: problem-331-cross-flips @@ -8,26 +8,28 @@ dashedName: problem-331-cross-flips # --description-- -N×N disks are placed on a square game board. Each disk has a black side and white side. +Discos NxN são colocados em um tabuleiro de jogo quadrado. Cada disco tem um lado preto e um lado branco. -At each turn, you may choose a disk and flip all the disks in the same row and the same column as this disk: thus 2×N-1 disks are flipped. The game ends when all disks show their white side. The following example shows a game on a 5×5 board. +A cada turno você pode escolher um disco e virar todos os discos na mesma linha e na mesma coluna que este disco: portanto, $2 × N - 1$ discos são virados. O jogo termina quando todos os discos mostrarem o lado branco. O exemplo a seguir mostra um jogo em um tabuleiro 5×5. -It can be proven that 3 is the minimal number of turns to finish this game. +animação mostrando o jogo no tabuleiro 5x5 -The bottom left disk on the N×N board has coordinates (0,0); the bottom right disk has coordinates (N-1,0) and the top left disk has coordinates (0,N-1). +Pode-se provar que 3 é o número mínimo de turnos para terminar este jogo. -Let CN be the following configuration of a board with N×N disks: A disk at (x,y) satisfying , shows its black side; otherwise, it shows its white side. C5 is shown above. +O disco do canto inferior esquerdo no tabuleiro $N×N$ tem coordenadas (0, 0). O disco inferior direito tem coordenadas ($N - 1$,$0$) e o disco superior esquerdo têm coordenadas ($0$,$N - 1$). -Let T(N) be the minimal number of turns to finish a game starting from configuration CN or 0 if configuration CN is unsolvable. We have shown that T(5)=3. You are also given that T(10)=29 and T(1 000)=395253. +Considere $C_N$ como sendo a seguinte configuração de tabuleiro com $N × N$ discos: um disco em ($x$, $y$) satisfazendo $N - 1 \le \sqrt{x^2 + y^2} \lt N$, shows exibe o lado preto; do contrário, ele exibe o lado branco. $C_5$ é mostrado acima. -Find . +Considere $T(N)$ como o número mínimo de turnos para concluir um jogo começando da configuração $C_N$ ou 0 se a configuração $C_N$ não tiver resolução. Mostramos que $T(5) = 3$. Você também é informado de que $T(10) = 29$ e $T(1.000) = 395.253$. + +Encontre $\displaystyle \sum_{i = 3}^{31} T(2^i - i)$. # --hints-- -`euler331()` should return 467178235146843500. +`crossFlips()` deve retornar `467178235146843500`. ```js -assert.strictEqual(euler331(), 467178235146843500); +assert.strictEqual(crossFlips(), 467178235146843500); ``` # --seed-- @@ -35,12 +37,12 @@ assert.strictEqual(euler331(), 467178235146843500); ## --seed-contents-- ```js -function euler331() { +function crossFlips() { return true; } -euler331(); +crossFlips(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-332-spherical-triangles.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-332-spherical-triangles.md index ea3a4d0c43..4c35678566 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-332-spherical-triangles.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-332-spherical-triangles.md @@ -1,6 +1,6 @@ --- id: 5900f4b91000cf542c50ffcb -title: 'Problem 332: Spherical triangles' +title: 'Problema 332: Triângulos esféricos' challengeType: 5 forumTopicId: 301990 dashedName: problem-332-spherical-triangles @@ -8,20 +8,28 @@ dashedName: problem-332-spherical-triangles # --description-- -A spherical triangle is a figure formed on the surface of a sphere by three great circular arcs intersecting pairwise in three vertices. +Um triângulo esférico é uma figura formada na superfície de uma esfera por três grandes arcos circulares que se cruzam entre pares em três vértices. -Let C(r) be the sphere with the centre (0,0,0) and radius r. Let Z(r) be the set of points on the surface of C(r) with integer coordinates. Let T(r) be the set of spherical triangles with vertices in Z(r). Degenerate spherical triangles, formed by three points on the same great arc, are not included in T(r). Let A(r) be the area of the smallest spherical triangle in T(r). +triângulo esférico formado na superfície de uma esfera -For example A(14) is 3.294040 rounded to six decimal places. +Considere $C(r)$ como a esfera com o centro (0,0,0) e raio $r$. -Find A(r). Give your answer rounded to six decimal places. +Considere $Z(r)$ como o conjunto de pontos na superfície de $C(r)$ com coordenadas em números inteiros. + +Considere $T(r)$ como o conjunto de triângulos esféricos com vértices em $Z(r)$. Triângulos esféricos degenerados, formados por três pontos no mesmo grande arco, não estão incluídos em $T(r)$. + +Considere $A(r)$ como a área do menor triângulo esférico em $T(r)$. + +Por exemplo, $A(14)$ é 3,294040 arredondado para seis casas decimais. + +Encontre $\displaystyle \sum_{r = 1}^{50} A(r)$. Dê sua resposta arredondada para seis casas decimais. # --hints-- -`euler332()` should return 2717.751525. +`sphericalTriangles()` deve retornar `2717.751525`. ```js -assert.strictEqual(euler332(), 2717.751525); +assert.strictEqual(sphericalTriangles(), 2717.751525); ``` # --seed-- @@ -29,12 +37,12 @@ assert.strictEqual(euler332(), 2717.751525); ## --seed-contents-- ```js -function euler332() { +function sphericalTriangles() { return true; } -euler332(); +sphericalTriangles(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-333-special-partitions.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-333-special-partitions.md index 5af490eb7e..216034dba9 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-333-special-partitions.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-333-special-partitions.md @@ -1,6 +1,6 @@ --- id: 5900f4b91000cf542c50ffcc -title: 'Problem 333: Special partitions' +title: 'Problema 333: Partições especiais' challengeType: 5 forumTopicId: 301991 dashedName: problem-333-special-partitions @@ -8,26 +8,28 @@ dashedName: problem-333-special-partitions # --description-- -All positive integers can be partitioned in such a way that each and every term of the partition can be expressed as 2ix3j, where i,j ≥ 0. +Todos os números inteiros positivos podem ser divididos de tal forma que cada termo da partição pode ser expresso como $2^i \times 3^j$, onde $i, j ≥ 0$. -Let's consider only those such partitions where none of the terms can divide any of the other terms. For example, the partition of 17 = 2 + 6 + 9 = (21x30 + 21x31 + 20x32) would not be valid since 2 can divide 6. Neither would the partition 17 = 16 + 1 = (24x30 + 20x30) since 1 can divide 16. The only valid partition of 17 would be 8 + 9 = (23x30 + 20x32). +Consideremos apenas aquelas partições em que nenhum dos termos pode dividir qualquer um dos outros termos. Por exemplo, a partição de $17 = 2 + 6 + 9 = (2^1 \times 3^0 + 2^1 \times 3^1 + 2^0 \times 3^2)$ não seria válida, pois 2 pode dividir 6. Tão pouco a partição $17 = 16 + 1 = (2^4 \times 3^0 + 2^0 \times 3^0)$ seria válida, já que 1 pode dividir 16. A única partição válida de 17 seria $8 + 9 = (2^3 \times 3^0 + 2^0 \times 3^2)$. -Many integers have more than one valid partition, the first being 11 having the following two partitions. 11 = 2 + 9 = (21x30 + 20x32) 11 = 8 + 3 = (23x30 + 20x31) +Muitos números inteiros têm mais de uma partição válida, sendo o primeiro 11 tendo as duas partições que seguem. -Let's define P(n) as the number of valid partitions of n. For example, P(11) = 2. +$$\begin{align} & 11 = 2 + 9 = (2^1 \times 3^0 + 2^0 \times 3^2) \\\\ & 11 = 8 + 3 = (2^3 \times 3^0 + 2^0 \times 3^1) \end{align}$$ -Let's consider only the prime integers q which would have a single valid partition such as P(17). +Vamos definir $P(n)$ como o número de partições válidas de $n$. Por exemplo, $P(11) = 2$. -The sum of the primes q <100 such that P(q)=1 equals 233. +Vamos considerar apenas os números inteiros primos $q$ que teriam uma única partição válida como $P(17)$. -Find the sum of the primes q <1000000 such that P(q)=1. +A soma dos primos $q <100$, tal que $P(q) = 1$ é igual a 233. + +Encontre a soma dos números primos $q < 1.000.000$ tal que $P(q) = 1$. # --hints-- -`euler333()` should return 3053105. +`specialPartitions()` deve retornar `3053105`. ```js -assert.strictEqual(euler333(), 3053105); +assert.strictEqual(specialPartitions(), 3053105); ``` # --seed-- @@ -35,12 +37,12 @@ assert.strictEqual(euler333(), 3053105); ## --seed-contents-- ```js -function euler333() { +function specialPartitions() { return true; } -euler333(); +specialPartitions(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-334-spilling-the-beans.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-334-spilling-the-beans.md index fe354cec8a..e02c93ec28 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-334-spilling-the-beans.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-334-spilling-the-beans.md @@ -1,6 +1,6 @@ --- id: 5900f4ba1000cf542c50ffcd -title: 'Problem 334: Spilling the beans' +title: 'Problema 334: Derramando feijões' challengeType: 5 forumTopicId: 301992 dashedName: problem-334-spilling-the-beans @@ -8,24 +8,26 @@ dashedName: problem-334-spilling-the-beans # --description-- -In Plato's heaven, there exist an infinite number of bowls in a straight line. Each bowl either contains some or none of a finite number of beans. A child plays a game, which allows only one kind of move: removing two beans from any bowl, and putting one in each of the two adjacent bowls. The game ends when each bowl contains either one or no beans. +No céu de Platão, existe um número infinito de tigelas em linha reta. Cada tigela contém alguns ou nenhum de um número finito de feijões. Uma criança joga um jogo, que permite apenas um tipo de movimento: remover dois feijões de qualquer tigela, e colocando um em cada uma das duas tigelas adjacentes. O jogo termina quando cada tigela contém um ou nenhum feijão. -For example, consider two adjacent bowls containing 2 and 3 beans respectively, all other bowls being empty. The following eight moves will finish the game: +Por exemplo, considere duas tigelas adjacentes contendo 2 e 3 feijões, respectivamente. Todas as outras estão vazias. Os oito movimentos seguintes terminarão o jogo: - +animação do jogo quando duas tigelas adjacentes contêm 2 e 3 feijões, respectivamente -You are given the following sequences: t0 = 123456. ti = ti-12, if ti-1 is even ti-12 926252, if ti-1 is odd where ⌊x⌋ is the floor function and is the bitwise XOR operator. bi = ( ti mod 211) + 1. +Você recebe as seguintes sequências: -The first two terms of the last sequence are b1 = 289 and b2 = 145. If we start with b1 and b2 beans in two adjacent bowls, 3419100 moves would be required to finish the game. +$$\begin{align} & t_0 = 123456, \\\\ & t_i = \begin{cases} \frac{t_{i - 1}}{2}, & \text{if $t_{i - 1}$ é par} \\\\ \left\lfloor\frac{t_{i - 1}}{2}\right\rfloor \oplus 926252, & \text{if $t_{i - 1}$ é ímpar} \end{cases} \\\\ & \qquad \text{onde $⌊x⌋$ é a função de base e $\oplus$ é o operador bitwise XOR.} \\\\ & b_i = (t_i\bmod 2^{11}) + 1. \end{align}$$ -Consider now 1500 adjacent bowls containing b1, b2,..., b1500 beans respectively, all other bowls being empty. Find how many moves it takes before the game ends. +Os dois primeiros termos da última sequência são $b_1 = 289$ e $b_2 = 145$. Se começarmos com $b_1$ e $b_2$ feijões em duas tigelas adjacentes, 3419100 movimentos seriam necessários para terminar o jogo. + +Considere agora 1500 tigelas adjacentes contendo $b_1, b_2, \ldots, b_{1500}$ feijões, respectivamente. Todas as outras tigelas estão vazias. Descubra quantos movimentos são necessários antes de o jogo terminar. # --hints-- -`euler334()` should return 150320021261690850. +`spillingTheBeans()` deve retornar `150320021261690850`. ```js -assert.strictEqual(euler334(), 150320021261690850); +assert.strictEqual(spillingTheBeans(), 150320021261690850); ``` # --seed-- @@ -33,12 +35,12 @@ assert.strictEqual(euler334(), 150320021261690850); ## --seed-contents-- ```js -function euler334() { +function spillingTheBeans() { return true; } -euler334(); +spillingTheBeans(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-335-gathering-the-beans.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-335-gathering-the-beans.md index 0605e0d053..b24366e39d 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-335-gathering-the-beans.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-335-gathering-the-beans.md @@ -1,6 +1,6 @@ --- id: 5900f4bd1000cf542c50ffce -title: 'Problem 335: Gathering the beans' +title: 'Problema 335: Juntando feijões' challengeType: 5 forumTopicId: 301993 dashedName: problem-335-gathering-the-beans @@ -8,20 +8,22 @@ dashedName: problem-335-gathering-the-beans # --description-- -Whenever Peter feels bored, he places some bowls, containing one bean each, in a circle. After this, he takes all the beans out of a certain bowl and drops them one by one in the bowls going clockwise. He repeats this, starting from the bowl he dropped the last bean in, until the initial situation appears again. For example with 5 bowls he acts as follows: +Sempre que Peter se sente entediado, coloca algumas tigelas, contendo um feijão em cada, em um círculo. Depois disso, ele tira todos os feijões de uma determinada tigela e os coloca um a um nos copos indo no sentido horário. Ele repete isso, começando pela tigela em que deixou cair o último feijão, até que a situação inicial volte a aparecer. Por exemplo, com 5 tigelas, ele age da seguinte forma: -So with 5 bowls it takes Peter 15 moves to return to the initial situation. +animação de mover feijões em 5 tigelas -Let M(x) represent the number of moves required to return to the initial situation, starting with x bowls. Thus, M(5) = 15. It can also be verified that M(100) = 10920. +Assim, com 5 tigelas, é preciso que Peter faça 15 movimentos para regressar à situação inicial. -Find M(2k+1). Give your answer modulo 79. +Considere $M(x)$ como a representação do número de movimentos necessários para retornar à situação inicial, começando com $x$ tigelas. Assim, $M(5) = 15$. Pode-se verificar que $M(100) = 10920$. + +Encontre $\displaystyle\sum_{k = 0}^{{10}^{18}} M(2^k + 1)$. Dê sua resposta modulo $7^9$. # --hints-- -`euler335()` should return 5032316. +`gatheringTheBeans()` deve retornar `5032316`. ```js -assert.strictEqual(euler335(), 5032316); +assert.strictEqual(gatheringTheBeans(), 5032316); ``` # --seed-- @@ -29,12 +31,12 @@ assert.strictEqual(euler335(), 5032316); ## --seed-contents-- ```js -function euler335() { +function gatheringTheBeans() { return true; } -euler335(); +gatheringTheBeans(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-336-maximix-arrangements.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-336-maximix-arrangements.md index 3dbf18111c..b1e1fa7a37 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-336-maximix-arrangements.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-336-maximix-arrangements.md @@ -1,6 +1,6 @@ --- id: 5900f4bd1000cf542c50ffcf -title: 'Problem 336: Maximix Arrangements' +title: 'Problema 336: Arranjos maximix' challengeType: 5 forumTopicId: 301994 dashedName: problem-336-maximix-arrangements @@ -8,26 +8,34 @@ dashedName: problem-336-maximix-arrangements # --description-- -A train is used to transport four carriages in the order: ABCD. However, sometimes when the train arrives to collect the carriages they are not in the correct order. +Um trem é usado para transportar quatro vagões na ordem: $ABCD$. No entanto, por vezes, quando o trem chega para coletar os vagões, eles não estão na ordem certa. -To rearrange the carriages they are all shunted on to a large rotating turntable. After the carriages are uncoupled at a specific point the train moves off the turntable pulling the carriages still attached with it. The remaining carriages are rotated 180 degrees. All of the carriages are then rejoined and this process is repeated as often as necessary in order to obtain the least number of uses of the turntable. +Para reorganizar os vagões, todos eles são empurrados para uma grande prato giratório. Depois de os vagões serem separados em um ponto específico, o trem sai do prato tirando os vagões que ainda estão presos a ele. Os vagões restantes são girados 180°. Todos os vagões são depois reagrupados e este processo é repetido sempre que necessário para obter o menor número de utilizações do prato. -Some arrangements, such as ADCB, can be solved easily: the carriages are separated between A and D, and after DCB are rotated the correct order has been achieved. +Alguns arranjos, como $ADCB$, podem ser resolvidos facilmente: os vagões são separados entre $A$ e $D$, e depois de $DCB$ ser girado, a ordem correta é alcançada. -However, Simple Simon, the train driver, is not known for his efficiency, so he always solves the problem by initially getting carriage A in the correct place, then carriage B, and so on. +No entanto, Simon Simples, o motorista do trem, não é conhecido pela sua eficiência. Então, ele sempre resolve o problema ao receber inicialmente o vagão $A$ no lugar correto, depois o vagão $B$ e assim por diante. -Using four carriages, the worst possible arrangements for Simon, which we shall call maximix arrangements, are DACB and DBAC; each requiring him five rotations (although, using the most efficient approach, they could be solved using just three rotations). The process he uses for DACB is shown below. +Usando quatro vagões, o pior arranjo possível para Simon, que chamaremos de arranjo máximo, é $DACB$ e $DBAC$; cada um deles exigindo cinco rotações (embora, usando a abordagem mais eficiente, eles possam ser reagrupados usando apenas três rotações). O processo que ele usa para $DACB$ é mostrado abaixo. -It can be verified that there are 24 maximix arrangements for six carriages, of which the tenth lexicographic maximix arrangement is DFAECB. +cinco rotações para o arranjo maximix DACB -Find the 2011th lexicographic maximix arrangement for eleven carriages. +É possível verificar que há 24 arranjos maximix para seis vagões, dos quais $DFAECB$ é o décimo arranjo maximix lexicográfico. + +Encontre o ${2011}^{\text{o}}$ arranjo maximix lexicográfico para onze vagões. # --hints-- -`euler336()` should return CAGBIHEFJDK. +`maximixArrangements()` deve retornar uma string. ```js -assert.strictEqual(euler336(), CAGBIHEFJDK); +assert(typeof maximixArrangements() === 'string'); +``` + +`maximixArrangements()` deve retornar a string `CAGBIHEFJDK`. + +```js +assert.strictEqual(maximixArrangements(), 'CAGBIHEFJDK'); ``` # --seed-- @@ -35,12 +43,12 @@ assert.strictEqual(euler336(), CAGBIHEFJDK); ## --seed-contents-- ```js -function euler336() { +function maximixArrangements() { return true; } -euler336(); +maximixArrangements(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-337-totient-stairstep-sequences.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-337-totient-stairstep-sequences.md index 677c918f05..970ad72de8 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-337-totient-stairstep-sequences.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-337-totient-stairstep-sequences.md @@ -1,6 +1,6 @@ --- id: 5900f4be1000cf542c50ffd0 -title: 'Problem 337: Totient Stairstep Sequences' +title: 'Problema 337: Sequências de degraus totientes' challengeType: 5 forumTopicId: 301995 dashedName: problem-337-totient-stairstep-sequences @@ -8,28 +8,28 @@ dashedName: problem-337-totient-stairstep-sequences # --description-- -Let {a1, a2,..., an} be an integer sequence of length n such that: +Considere $\\{a_1, a_2, \ldots, a_n\\}$ como uma sequência de números inteiros de comprimento $n$, tal que: -a1 = 6 +- $a_1 = 6$ +- para todo $1 ≤ i < n$ : $φ(a_i) < φ(a_{i + 1}) < a_i < a_{i + 1}$ -for all 1 ≤ i < n : φ(ai) < φ(ai+1) < ai < ai+11 +$φ$ denota a função totiente de Euler. -Let S(N) be the number of such sequences with an ≤ N. +Considere $S(N)$ como o número dessas sequências, com $a_n ≤ N$. -For example, S(10) = 4: {6}, {6, 8}, {6, 8, 9} and {6, 10}. +Por exemplo, $S(10) = 4$: {6}, {6, 8}, {6, 8, 9} e {6, 10}. -We can verify that S(100) = 482073668 and S(10 000) mod 108 = 73808307. +Podemos verificar que $S(100) = 482.073.668$ e $S(10.000)\bmod {10}^8 = 73.808.307$. -Find S(20 000 000) mod 108. +Encontre $S(20.000.000)\bmod {10}^8$. -1 φ denotes Euler's totient function. # --hints-- -`euler337()` should return 85068035. +`totientStairstepSequences()` deve retornar `85068035`. ```js -assert.strictEqual(euler337(), 85068035); +assert.strictEqual(totientStairstepSequences(), 85068035); ``` # --seed-- @@ -37,12 +37,12 @@ assert.strictEqual(euler337(), 85068035); ## --seed-contents-- ```js -function euler337() { +function totientStairstepSequences() { return true; } -euler337(); +totientStairstepSequences(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-338-cutting-rectangular-grid-paper.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-338-cutting-rectangular-grid-paper.md index 514dc560b0..923a64b547 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-338-cutting-rectangular-grid-paper.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-338-cutting-rectangular-grid-paper.md @@ -1,6 +1,6 @@ --- id: 5900f4be1000cf542c50ffd1 -title: 'Problem 338: Cutting Rectangular Grid Paper' +title: 'Problema 338: Corte de papel de grade retangular' challengeType: 5 forumTopicId: 301996 dashedName: problem-338-cutting-rectangular-grid-paper @@ -8,26 +8,28 @@ dashedName: problem-338-cutting-rectangular-grid-paper # --description-- -A rectangular sheet of grid paper with integer dimensions w × h is given. Its grid spacing is 1. +Você recebe uma folha retangular de papel de grade com dimensões em números inteiros $w$ × $h$. O espaçamento da grade é de 1. -When we cut the sheet along the grid lines into two pieces and rearrange those pieces without overlap, we can make new rectangles with different dimensions. +Quando cortamos as folhas ao longo das linhas da grade em duas partes e reorganizamos essas peças sem sobreposição, podemos criar novos retângulos com dimensões diferentes. -For example, from a sheet with dimensions 9 × 4 , we can make rectangles with dimensions 18 × 2, 12 × 3 and 6 × 6 by cutting and rearranging as below: +Por exemplo, a partir de uma folha com dimensões 9 × 4, podemos fazer retângulos com dimensões 18 × 2, 12 × 3 e 6 × 6 cortando e reorganizando como vemos abaixo: -Similarly, from a sheet with dimensions 9 × 8 , we can make rectangles with dimensions 18 × 4 and 12 × 6 . +folha com dimensões 9 x 4 cortada em três maneiras diferentes para criar retângulos com dimensões 18 x 2, 12 x 3 e 6 x 6 -For a pair w and h, let F(w,h) be the number of distinct rectangles that can be made from a sheet with dimensions w × h . For example, F(2,1) = 0, F(2,2) = 1, F(9,4) = 3 and F(9,8) = 2. Note that rectangles congruent to the initial one are not counted in F(w,h). Note also that rectangles with dimensions w × h and dimensions h × w are not considered distinct. +Da mesma forma, a partir de uma folha com dimensões 9 × 8, podemos fazer retângulos com dimensões 18 × 4 e 12 × 6. -For an integer N, let G(N) be the sum of F(w,h) for all pairs w and h which satisfy 0 < h ≤ w ≤ N. We can verify that G(10) = 55, G(103) = 971745 and G(105) = 9992617687. +Para um par $w$ e $h$, considere $F(w, h)$ como o número de retângulos distintos que podem ser feitos a partir de uma folha com dimensões $w$ × $h$. Por exemplo, $F(2, 1) = 0$, $F(2, 2) = 1$, $F(9, 4) = 3$ e $F(9, 8) = 2$. Observe que os retângulos congruentes com o inicial não são contados em $F(w, h)$. Observe também que os retângulos com dimensões $w$ × $h$ e as dimensões $h$ × $w$ não são considerados distintos. -Find G(1012). Give your answer modulo 108. +Para um número inteiro $N$, considere $G(N)$ como a soma de $F(w, h)$ para todos os pares $w$ e $h$ que satisfazem $0 < h ≤ w ≤ N$. Podemos verificar que $G(10) = 55$, $G({10}^3) = 971.745$ e $G({10}^5) = 9.992.617.687$. + +Encontre $G({10}^{12})$. Dê sua resposta modulo ${10}^8$. # --hints-- -`euler338()` should return 15614292. +`cuttingRectangularGridPaper()` deve retornar `15614292`. ```js -assert.strictEqual(euler338(), 15614292); +assert.strictEqual(cuttingRectangularGridPaper(), 15614292); ``` # --seed-- @@ -35,12 +37,12 @@ assert.strictEqual(euler338(), 15614292); ## --seed-contents-- ```js -function euler338() { +function cuttingRectangularGridPaper() { return true; } -euler338(); +cuttingRectangularGridPaper(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-339-peredur-fab-efrawg.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-339-peredur-fab-efrawg.md index 6844c7e65c..5d67a21338 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-339-peredur-fab-efrawg.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-339-peredur-fab-efrawg.md @@ -1,6 +1,6 @@ --- id: 5900f4c01000cf542c50ffd2 -title: 'Problem 339: Peredur fab Efrawg' +title: 'Problema 339: Peredur fab Efrawg' challengeType: 5 forumTopicId: 301997 dashedName: problem-339-peredur-fab-efrawg @@ -8,18 +8,20 @@ dashedName: problem-339-peredur-fab-efrawg # --description-- -"And he came towards a valley, through which ran a river; and the borders of the valley were wooded, and on each side of the river were level meadows. And on one side of the river he saw a flock of white sheep, and on the other a flock of black sheep. And whenever one of the white sheep bleated, one of the black sheep would cross over and become white; and when one of the black sheep bleated, one of the white sheep would cross over and become black."en.wikisource.org +"E ele veio na direção de um vale, pelo qual atravessava um rio; e as fronteiras do vale tinham bosques, e de cada lado do rio haviam planícies verdes. De um lado do rio, ele viu um rebanho de ovelhas brancas. Do outro, um rebanho de ovelhas negras. E sempre que uma das ovelhas brancas balia, uma das ovelhas negras cruzava e se tornava branca. Quando uma das ovelhas negras balia, uma das ovelhas brancas cruzava e se tornava negra." - Peredur, filho de Evrawc -Initially each flock consists of n sheep. Each sheep (regardless of colour) is equally likely to be the next sheep to bleat. After a sheep has bleated and a sheep from the other flock has crossed over, Peredur may remove a number of white sheep in order to maximize the expected final number of black sheep. Let E(n) be the expected final number of black sheep if Peredur uses an optimal strategy. +Inicialmente, cada rebanho consiste em $n$ ovelhas. Cada ovelha (independente da cor) tem a mesma probabilidade de ser a ovelha seguinte a balir. Depois que uma ovelha balir e que uma ovelha do outro rebanho tiver cruzado, Peredur pode remover um número de ovelhas brancas para maximizar o número final esperado de ovelhas negras. Considere $E(n)$ como o número final esperado de ovelhas negras se Peredur usar uma estratégia ideal. -You are given that E(5) = 6.871346 rounded to 6 places behind the decimal point. Find E(10 000) and give your answer rounded to 6 places behind the decimal point. +Você é informado de que $E(5) = 6,871346$, arredondado para 6 casas decimais depois da vírgula. + +Encontre $E(10.000)$ e dê sua resposta arredondada para 6 casas decimais depois da vírgula. # --hints-- -`euler339()` should return 19823.542204. +`peredurFabEfrawg()` deve retornar `19823.542204`. ```js -assert.strictEqual(euler339(), 19823.542204); +assert.strictEqual(peredurFabEfrawg(), 19823.542204); ``` # --seed-- @@ -27,12 +29,12 @@ assert.strictEqual(euler339(), 19823.542204); ## --seed-contents-- ```js -function euler339() { +function peredurFabEfrawg() { return true; } -euler339(); +peredurFabEfrawg(); ``` # --solutions-- diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-340-crazy-function.md b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-340-crazy-function.md index 86b29f061e..9d117967a5 100644 --- a/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-340-crazy-function.md +++ b/curriculum/challenges/portuguese/10-coding-interview-prep/project-euler/problem-340-crazy-function.md @@ -1,6 +1,6 @@ --- id: 5900f4c21000cf542c50ffd4 -title: 'Problem 340: Crazy Function' +title: 'Problema 340: Função maluca' challengeType: 5 forumTopicId: 301999 dashedName: problem-340-crazy-function @@ -8,24 +8,22 @@ dashedName: problem-340-crazy-function # --description-- -For fixed integers a, b, c, define the crazy function F(n) as follows: +Para números inteiros fixos $a$, $b$, $c$, defina a função maluca $F(n)$ da seguinte forma: -F(n) = n - c for all n > b +$$\begin{align} & F(n) = n - c \\;\text{ para todo } n > b \\\\ & F(n) = F(a + F(a + F(a + F(a + n)))) \\;\text{ para todo } n ≤ b. \end{align}$$ -F(n) = F(a + F(a + F(a + F(a + n)))) for all n ≤ b. +Além disso, defina $S(a, b, c) = \displaystyle\sum_{n = 0}^b F(n)$. -Also, define S(a, b, c) = . +Por exemplo, se $a = 50$, $b = 2000$ e $c = 40$, então $F(0) = 3240$ e $F(2000) = 2040$. Além disso, $S(50, 2000, 40) = 5.204.240$. -For example, if a = 50, b = 2000 and c = 40, then F(0) = 3240 and F(2000) = 2040. Also, S(50, 2000, 40) = 5204240. - -Find the last 9 digits of S(217, 721, 127). +Encontre os últimos 9 algarismos de $S({21}^7, 7^{21}, {12}^7)$. # --hints-- -`euler340()` should return 291504964. +`crazyFunction()` deve retornar `291504964`. ```js -assert.strictEqual(euler340(), 291504964); +assert.strictEqual(crazyFunction(), 291504964); ``` # --seed-- @@ -33,12 +31,12 @@ assert.strictEqual(euler340(), 291504964); ## --seed-contents-- ```js -function euler340() { +function crazyFunction() { return true; } -euler340(); +crazyFunction(); ``` # --solutions--