Skip to content

Commit

Permalink
Problema: 2514
Browse files Browse the repository at this point in the history
  • Loading branch information
lrlucena committed Jun 1, 2024
1 parent 76608cf commit cfd8e9a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Join the chat at https://gitter.im/potigol/Potigol](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/potigol/Potigol?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Follow us](https://img.shields.io/twitter/follow/potigol.svg?style=social)](http://twitter.com/potigol)
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/potigol/beecrowd)
[![Soluções](https://img.shields.io/badge/Problemas%20Resolvidos-808-blue)](https://github.com/potigol/beecrowd/commits/master)
[![Soluções](https://img.shields.io/badge/Problemas%20Resolvidos-809-blue)](https://github.com/potigol/beecrowd/commits/master)

<!-- a href="https://potigol.github.io/docs/hacktoberfest"><img src="https://hacktoberfest.digitalocean.com/_nuxt/img/logo-hacktoberfest-full.f42e3b1.svg" width=250></a -->

Expand Down
4 changes: 2 additions & 2 deletions categorias/matemtica.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Matemática (89 / 269)
# Matemática (90 / 269)



Expand Down Expand Up @@ -61,6 +61,7 @@
- [x] [2232](https://www.beecrowd.com.br/repository/UOJ_2232.html) - [Triângulo de Pascal](https://github.com/potigol/beecrowd/blob/master/src/2200/2232.poti)
- [x] [2238](https://www.beecrowd.com.br/repository/UOJ_2238.html) - [Divisores](https://github.com/potigol/beecrowd/blob/master/src/2200/2238.poti)
- [x] [2497](https://www.beecrowd.com.br/repository/UOJ_2497.html) - [Contando Ciclos](https://github.com/potigol/beecrowd/blob/master/src/2400/2497.poti)
- [x] [2514](https://www.beecrowd.com.br/repository/UOJ_2514.html) - [Alinhamento Lunar](https://github.com/potigol/beecrowd/blob/master/src/2500/2514.poti)
- [x] [2516](https://www.beecrowd.com.br/repository/UOJ_2516.html) - [Corrida](https://github.com/potigol/beecrowd/blob/master/src/2500/2516.poti)
- [x] [2584](https://www.beecrowd.com.br/repository/UOJ_2584.html) - [Pentágono](https://github.com/potigol/beecrowd/blob/master/src/2500/2584.poti)
- [x] [2596](https://www.beecrowd.com.br/repository/UOJ_2596.html) - [Xenlonguinho](https://github.com/potigol/beecrowd/blob/master/src/2500/2596.poti)
Expand Down Expand Up @@ -224,7 +225,6 @@
- [ ] [2499](https://www.beecrowd.com.br/repository/UOJ_2499.html) - Triângulo Interno
- [ ] [2500](https://www.beecrowd.com.br/repository/UOJ_2500.html) - William Xorando
- [ ] [2505](https://www.beecrowd.com.br/repository/UOJ_2505.html) - Autopotencial
- [ ] [2514](https://www.beecrowd.com.br/repository/UOJ_2514.html) - Alinhamento Lunar
- [ ] [2589](https://www.beecrowd.com.br/repository/UOJ_2589.html) - Maior Distância Entre Primos Consecutivos
- [ ] [2636](https://www.beecrowd.com.br/repository/UOJ_2636.html) - 3-RSA
- [ ] [2660](https://www.beecrowd.com.br/repository/UOJ_2660.html) - Cigarras Periódicas
Expand Down
20 changes: 20 additions & 0 deletions src/2500/2514.poti
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
mmc(x, y: Inteiro) = x * y div mdc(x, y)

mdc(x, y: Inteiro): Inteiro =
se y == 0 então x senão mdc(y, x mod y) fim

mmc_triplo(x, y, z: Inteiro) = mmc(x, mmc(y, z))

proximo_alinhamento(m, l1, l2, l3: Inteiro)
periodo = mmc_triplo(l1, l2, l3)
anos_faltantes = periodo - m
retorne anos_faltantes
fim

var m := leia_inteiro
enquanto m > 0 faça
l = leia_inteiros(" ")
anos_faltantes = proximo_alinhamento(m, l[1], l[2], l[3])
escreva anos_faltantes
m := leia_inteiro
fim
4 changes: 2 additions & 2 deletions src/2500/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Problemas 2500 (33%)
# Problemas 2500 (34%)

- [ ] [2500](https://www.beecrowd.com.br/repository/UOJ_2500.html) - William Xorando *Matemática*
- [ ] [2501](https://www.beecrowd.com.br/repository/UOJ_2501.html) - Fatores Permitidos *Paradigmas*
Expand All @@ -14,7 +14,7 @@
- [ ] [2511](https://www.beecrowd.com.br/repository/UOJ_2511.html) - WWW *Ad-Hoc*
- [ ] [2512](https://www.beecrowd.com.br/repository/UOJ_2512.html) - O Jogo Reverse *Ad-Hoc*
- [ ] [2513](https://www.beecrowd.com.br/repository/UOJ_2513.html) - Xoringan *Ad-Hoc*
- [ ] [2514](https://www.beecrowd.com.br/repository/UOJ_2514.html) - Alinhamento Lunar *Matemática*
- [x] [2514](https://www.beecrowd.com.br/repository/UOJ_2514.html) - [Alinhamento Lunar](https://github.com/potigol/beecrowd/blob/master/src/2500/2514.poti) *Matemática*
- [ ] [2515](https://www.beecrowd.com.br/repository/UOJ_2515.html) - Bolacha *Ad-Hoc*
- [x] [2516](https://www.beecrowd.com.br/repository/UOJ_2516.html) - [Corrida](https://github.com/potigol/beecrowd/blob/master/src/2500/2516.poti) *Matemática*
- [ ] [2517](https://www.beecrowd.com.br/repository/UOJ_2517.html) - Desafio PoGro *Geometria Computacional*
Expand Down

0 comments on commit cfd8e9a

Please sign in to comment.