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

Develop #593

Closed
wants to merge 2 commits into from
Closed
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,6 @@ yarn-error.log
.yarn-integrity

.node-version

src/__generated__/*
static/keyword*
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,3 @@
- 🦞 AWS Amplify
- ~~🦐 SCSS~~
- I decided not to use scss 😉. The evolution of css is amazing 😍.

## ✍️ Template

テンプレートとして利用したい方こちらから(作成中)。

Click here to use as a template(in preparation).

https://github.com/kento-yoshidu/GatsbyBlog/tree/template
52 changes: 49 additions & 3 deletions 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-19"
update: "2023-12-22"
seriesName: "競プロで学ぶRust"
seriesSlug: "LearningRustThoughKyouPro"
description: "アルゴリズムやデータ構造ごとに解ける問題を分類しました。"
Expand Down Expand Up @@ -1370,11 +1370,58 @@ mod tests {
```
</details>

### ABC155 C - Poll

[C - Poll](https://atcoder.jp/contests/abc155/tasks/abc155_c)(<span style="color: gray">Difficulty : 236</span>)

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

```rust
// https://atcoder.jp/contests/abc155/tasks/abc155_c

use std::collections::HashMap;

pub fn run(_n: usize, h: Vec<&str>) -> Vec<String> {
let mut hash_map = HashMap::new();

for s in h {
*hash_map.entry(s).or_insert(0) += 1;
}

let max_value = hash_map.values().max().unwrap();

let mut ans = hash_map.iter()
.filter(|e| e.1 == max_value)
.map(|e| e.0.to_string())
.collect::<Vec<String>>();

ans.sort();

ans
}

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

#[test]
fn test() {
assert_eq!(vec!["beet", "vet"], run(7, vec!["beat", "vet", "beet", "bed", "vet", "bet", "beet"]));
assert_eq!(vec!["buffalo"], run(8, vec!["buffalo", "buffalo", "buffalo", "buffalo", "buffalo", "buffalo", "buffalo", "buffalo"]));
assert_eq!(vec!["kick"], run(7, vec!["bass", "bass", "kick", "kick", "bass", "kick", "kick"]));
assert_eq!(vec!["kun", "nichia", "tapu", "ushi"], run(4, vec!["ushi", "tapu", "nichia", "kun"]));
}
}
```

</details>

## HashSet

### ABC226 B - Counting Arrays

[B - Counting Arrays](https://atcoder.jp/contests/abc226/tasks/abc226_b)
[B - Counting Arrays](https://atcoder.jp/contests/abc226/tasks/abc226_b)(<span style="color: gray">Difficulty : 192</span>)

<details>
<summary>コード例を見る</summary>
Expand Down Expand Up @@ -1474,7 +1521,6 @@ mod tests {
```
</details>


## 最小公倍数

### ABC148 C - Snack
Expand Down
Loading
Loading