Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🍛 Update #591

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 46 additions & 1 deletion content/blog/LearningRustThoughKyouPro/Ex1/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "[番外編] アルゴリズム・データ構造ごとに問題を分類してみる"
postdate: "2023-11-23"
update: "2023-12-16"
update: "2023-12-19"
seriesName: "競プロで学ぶRust"
seriesSlug: "LearningRustThoughKyouPro"
description: "アルゴリズムやデータ構造ごとに解ける問題を分類しました。"
Expand Down Expand Up @@ -1474,6 +1474,51 @@ mod tests {
```
</details>


## 最小公倍数

### ABC148 C - Snack

[C - Snack](https://atcoder.jp/contests/abc148/tasks/abc148_c)(<span style="color: gray">Difficulty : 82</span>)

<details>
<summary>コード例を見る</summary>

```rust
// https://atcoder.jp/contests/abc148/tasks/abc148_c

fn gcd(m: usize, n: usize) -> usize {
if n == 0 {
m
} else {
gcd(n, m % n)
}
}

pub fn run(a: usize, b: usize) -> usize {
a / gcd(a, b) * b
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test () {
assert_eq!(6, run(2, 3));
assert_eq!(18696, run(123, 456));
assert_eq!(9999900000, run(100000, 99999));
}
}
```
</details>

<aside>

最大公約数は[ユークリッドの互除法](http://localhost:8000/LearningRustThoughKyouPro/Ex1/#%E3%83%A6%E3%83%BC%E3%82%AF%E3%83%AA%E3%83%83%E3%83%89%E3%81%AE%E4%BA%92%E9%99%A4%E6%B3%95)を参照ください。

</aside>

## 回文判定

### 競技プログラミングの鉄則 B56 - Palindrome Queries
Expand Down
4 changes: 2 additions & 2 deletions src/__generated__/gatsby-types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.